note 103523 added to function.print-r
| From: | (joomla-jquery-internet.de) | Date: | Mon, 18 Apr 2011 14:09:55 +0000 |
| Subject: | note 103523 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178939@lists.php.net to get a copy of this message | ||
Since i use print_r for debugging a lot, i always use the following function in my scripts, which
makes life a lot easier :-)
if (!function_exists("preprint")) {
function preprint($s, $return=false) {
$x = "<pre>";
$x .= print_r($s, 1);
$x .= "</pre>";
if ($return) return $x;
else print $x;
}
}
-------------------
USAGE: preprint($x); <- where $x = array().
-------------------
The optional 2. parameter can be set to "true", so the html-code is returned.
Have fun,
----
Server IP: 217.160.235.204
Probable Submitter: 188.194.178.149
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- https://master.php.net/note/edit/103523
Del: integrated -- https://master.php.net/note/delete/103523/integrated
Del: useless -- https://master.php.net/note/delete/103523/useless
Del: bad code -- https://master.php.net/note/delete/103523/bad+code
Del: spam -- https://master.php.net/note/delete/103523/spam
Del: non-english -- https://master.php.net/note/delete/103523/non-english
Del: in docs -- https://master.php.net/note/delete/103523/in+docs
Del: other reasons-- https://master.php.net/note/delete/103523
Reject -- https://master.php.net/note/reject/103523
Search -- https://master.php.net/manage/user-notes.php