- array_search: documentation ( source)
- array_slice: documentation ( source)
<?php
$haystack = array(1,2,3,4,5,6,7,8,9,10);
$needle = array(3,4,5);
$bad_needle = array(3,5,4);
$offset = array_search($needle[0]);
$slice = array_slice($haystack, $offset, count($needle));
if ($slice === $needle) {
echo 'yes';
}