Php > Miscellaneous
Display array contents
Display array contents function LIST_CONTENTS($arrayname,$tab="    ",$indent=0) { // recursively displays contents of the array and sub-arrays: // Free for unrestricted use, except sale - do not resell. // use: echo LIST_CONTENTS(array $arrayname, string $tab, int $indent); // $tab = string to use as a tab, $indent = number of tabs to indent result while(list($key, $value) = each($arrayname)) { for($i=0; $i<$indent; $i++) $currenttab .= $tab; if (is_array($value)) { $retval .= "$currenttab$key : Array:
$currenttab{
"; $retval .= LIST_CONTENTS($value,$tab,$indent+1)."$currenttab}
"; } else $retval .= "$currenttab$key => $value
"; $currenttab = NULL; } return $retval; }
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage