badcrocodile
5/25/2015 - 3:06 AM

Recursive function to print all values in nested array.

Recursive function to print all values in nested array.

<?php 
function printNestedArray($a) {
  echo '<blockquote>';
  foreach($a as $key => $value) {
    echo $key:
    if(is_array($value)) {
      printNestedArray($value);
    } else {
      echo $value . '<br />';
    }
  }
  echo '</blockquote>';
}
?>