note 86187 added to function.print-r
| From: | schizodonotspammeduckie at gmail dot com | Date: | Tue, 07 Oct 2008 12:00:13 +0000 |
| Subject: | note 86187 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145119@lists.php.net to get a copy of this message | ||
my take on the highlighted markupped debug function:
/**
* print_array()
* Does a var_export of the array and returns it between <pre> tags
*
* @param mixed $var any input you can think of
* @return string HTML
*/
function print_array($var)
{
$input =var_export($var,true);
$input = preg_replace("! => \n\W+ array \(!Uims", " => Array ( ",
$input);
$input = preg_replace("!array \(\W+\),!Uims", "Array ( ),", $input);
return("<pre>".str_replace('><?', '>',
highlight_string('<'.'?'.$input, true))."</pre>");
}
----
Server IP: 83.137.20.135
Probable Submitter: 82.171.111.226
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- https://master.php.net/note/edit/86187
Del: integrated -- https://master.php.net/note/delete/86187/integrated
Del: useless -- https://master.php.net/note/delete/86187/useless
Del: bad code -- https://master.php.net/note/delete/86187/bad+code
Del: spam -- https://master.php.net/note/delete/86187/spam
Del: non-english -- https://master.php.net/note/delete/86187/non-english
Del: in docs -- https://master.php.net/note/delete/86187/in+docs
Del: other reasons-- https://master.php.net/note/delete/86187
Reject -- https://master.php.net/note/reject/86187
Search -- https://master.php.net/manage/user-notes.php