3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datos = array( "Nombre" => "Adrian", "Apellido" => "Madroñal", "Nacionalidad" => "Argentino", "Edad" => 28, "Telefono" => array( 'Casa' => array('COD' => '011', 'TEL' => '45565486'), 'Celular' => array('COD' => '011', 'TEL' => '5548846'), 'Trabajo' => '32154846' ) ); foreach ($datos as $elementos => $data){ if (is_array($data)){ foreach($data as $mas => $tel){ if (is_array($tel)) foreach ($tel as $cod => $tels){ echo $mas. $cod. $tels; echo "<br>"; } else { echo $mas. $tel. "<br>"; } } } else { echo $elementos. ": ". $data. "<br>"; } } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Nombre: Adrian<br>Apellido: Madroñal<br>Nacionalidad: Argentino<br>Edad: 28<br>CasaCOD011<br>CasaTEL45565486<br>CelularCOD011<br>CelularTEL5548846<br>Trabajo32154846<br>