取出关联数组的key值,可用 array_keys()取出;

 <?php
$a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander");
print_r(array_keys($a));
?>

输出结果

 Array ( [0] => Volvo [1] => BMW [2] => Toyota )

取出关联数组的values值,可用 array_values()取出;

 <?php
$a=array("Name"=>"Bill","Age"=>"60","Country"=>"USA");
print_r(array_values($a));
?>

输出结果

 Array ( [0] => Bill [1] => 60 [2] => USA )
05-11 13:52