【发布时间】:2012-11-01 01:25:18
【问题描述】:
我有以下数组:
$array = array (
'a' => 'A',
'b' => 'B',
'c' => 'C'
);
我想了解这种行为:
// true, normal behaviour, there is a 'A' value in my array
echo array_search('A', $array) === 'a';
// true, normal behaviour, there is no 1 value in my array
echo array_search(1, $array) === false;
// true ???? there is no 0 as value in my array
echo array_search(0, $array) === 'a';
为什么array_search(0, $array) 返回我数组的第一个键?
【问题讨论】:
标签: php arrays type-conversion