note 37929 added to function.var-export
| From: | MrJohnnieWalker at rn2 dot php dot net | Date: | Tue, 02 Dec 2003 16:29:58 +0000 |
| Subject: | note 37929 added to function.var-export | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61275@lists.php.net to get a copy of this message | ||
// Here's a recursive version for PHP > 4.2
function jw_var_export($inputArray,$indent="") {
$output .= "array (\n";
foreach($inputArray as $thisKey => $thisValue) {
$output .= "$indent$thisKey => ";
if (! is_array($thisValue)) {
$output .= "'$thisValue'";
} else {
$output .= jw_var_export($thisValue,"$indent ");
}
$output .= ",\n";
}
$output = substr($output,0,-2);
$output .= "$indent\n$indent)";
return $output;
}
// usage:
echo jw_var_export($anArray);
----
Manual Page -- http://www.php.net/manual/en/function.var-export.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37929
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37929&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37929&report=yes
Search -- http://master.php.net/manage/user-notes.php