maybe a simple question but I can't figure it out.. I try to put values from an array in a variable, but it doesn't seem to work.
$array = array(0 => 100, "color" => "red");
print_r(array_keys($array));
Outputs:
Array
(
[0] => 0
[1] => color
)
Then why can't I say:
print_r(array_keys($array[1]));
So it will output: color
How do I put color in a variable?
* Update: I work in PHP 5.3, unfortunately
print_r(array_keys($array)[1]);
don't work.