【发布时间】:2014-04-18 01:05:40
【问题描述】:
$array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
print_r(array_filter($array1, "odd"));
function odd($var)
{
// returns whether the input integer is odd//
return($var & 1);
}
在返回值中&操作符是什么??它如何返回奇数
【问题讨论】:
-
这里
&的用法与数组无关..考虑如果没有数组,奇数被称为odd(13)和odd(42)。 -
goto php.net/manual/en/function.array-filter.php -> 用户贡献的注释 -> searchBy("nicolaj")->read()
标签: php operator-keyword