Get value in array

Hi fellas,

I have an array like following:

$matriz = array(
“name”=>“Brazil”,
“population”=>“192.924.506”,
);

To get the value is easy, but I need to get name, not the value of name.

Is it possible?

Thanks in advance.

Sorry for any typos =]

Pawel, that’s exactly what I need, thanks!

Not sure what exactly you want to do but you can do:


$keys = array_keys($myArray);

// or

foreach ($myArray as $key => $value) {
    echo $key;
}