Use array_keys() method:
$array = array("color" => "blue", "size" => "small");
print_r(array_keys($array)); /* prints the following:
Array
Reference:
http://php.net/manual/en/function.array-keys.php
$array = array("color" => "blue", "size" => "small");
print_r(array_keys($array)); /* prints the following:
Array
(
[0] => color
[1] => size
)*/
http://php.net/manual/en/function.array-keys.php
No comments:
Post a Comment