note 98818 added to function.print-r
| From: | rjmunro at arjam dot net | Date: | Fri, 09 Jul 2010 13:43:18 +0000 |
| Subject: | note 98818 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170821@lists.php.net to get a copy of this message | ||
The output of this function is not encoded in HTML, and will look like a mess in a web browser. You
have to capture the output in an output buffer, then encode as HTML, then print.
I use the following:
<pre>
<?php
ob_start();
print_r(get_defined_vars());
echo htmlentities(ob_get_clean());
?>
</pre>
----
Server IP: 213.229.106.14
Probable Submitter: 81.136.206.155
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- https://master.php.net/note/edit/98818
Del: integrated -- https://master.php.net/note/delete/98818/integrated
Del: useless -- https://master.php.net/note/delete/98818/useless
Del: bad code -- https://master.php.net/note/delete/98818/bad+code
Del: spam -- https://master.php.net/note/delete/98818/spam
Del: non-english -- https://master.php.net/note/delete/98818/non-english
Del: in docs -- https://master.php.net/note/delete/98818/in+docs
Del: other reasons-- https://master.php.net/note/delete/98818
Reject -- https://master.php.net/note/reject/98818
Search -- https://master.php.net/manage/user-notes.php