Tengo un array con la siguiente estructura.
Código PHP:
Array
(
[0] => Array
(
[email] => john.doe@sendgrid.com
[timestamp] => 1337966810
[category] => Array
(
[0] => survey78399_
[1] => transactional
)
[event] => delivered
)
[1] => Array
(
[email] => juanito@email.com
[timestamp] => 1337966855
[category] => Array
(
[0] => survey78399
[1] => transactional
)
[event] => spam
)
[2] => Array
(
[email] => jajjaa@test.com
[timestamp] => 1337966899
[category] => Array
(
[0] => survey78399
[1] => transactional
)
[event] => open
)
[3] => Array
(
[email] => jane.doe@sendgrid.com
[timestamp] => 1337966899
[category] => survey78399
[event] => open
)
)
la funcion que uso para recorrer esto es :
Código PHP:
function recorro($matriz){
foreach($matriz as $key=>$value){
if (is_array($value)){
//si es un array sigo recorriendo
echo 'keyx:'. $key;
echo '<br>';
recorro($value);
}else{
//si es un elemento lo muestro
echo $key.': '.$value ;
echo '<br>';
}
}
}
Saludos