Last active
July 8, 2016 20:07
-
-
Save caiowilson/4db7586d9423d6ed19f13cfd4a869d1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function recursive($array){ | |
foreach($array as $key => $value){ | |
//If $value is an array. | |
if(is_array($value)){ | |
//We need to loop through it. | |
recursive($value); | |
} else{ | |
//It is not an array, so print it out. | |
echo $key . ": " . $value, '<br>'; | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment