使用
array_intersect
和
range
$input = array(10,20); $myrange = range(10,20); $output = array_intersect($input,$myrange ); print_r($output );