我有数字和可变数字的数组:
$a = array(1,2,3,4,5,6,7,8,9,10);
$v = 5;
我需要结果所有数字,如果高于$ v:
$result = ?? //array(6,7,8,9,10)
答案 0 :(得分:2)
<?php
$a = array(1,2,3,4,5,6,7,8,9,10);
$v = 5;
foreach($a as $value){
if($value > $v ){
$new[] = $value;
}
}
echo "<pre>";
print_r($new);