php常用函数
array_keys() 函数
函数返回包含数组中所有键名的一个新数组
$a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander"); print_r(array_keys($a));
Array ( [0] => Volvo [1] => BMW [2] => Toyota )
$a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander"); print_r(array_keys($a,"Highlander"));
Array ( [0] => Toyota )
$a=array(10,20,30,"10");
print_r(array_keys($a,"10",true));
Array ( [0] => 3 )
$a=array(10,20,30,"10"); print_r(array_keys($a,"10",false));
Array ( [0] => 0 [1] => 3 )