note 68027 added to function.print-r
| From: | shmohel at gmail dot com | Date: | Mon, 10 Jul 2006 16:51:58 +0000 |
| Subject: | note 68027 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114643@lists.php.net to get a copy of this message | ||
jcarouth,
The reason I don't like doing that is because print_r displays the output at the point in the
script where it is called. I much prefer to store this in a variable, so I can have it printed
wherever in the script I want it to be.
<?php
$html="<div>Info to display to browser.";
$html.=showarr($myarray);
$html.="</div>";
echo $html;
?>
This function comes in very handy when I use a template system which builds bits of the page and
them determines which order to out put them. Otherwise, I end up with the array outside of my
template.
----
Server IP: 64.71.164.2
Probable Submitter: 63.240.121.48
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- http://master.php.net/note/edit/68027
Del: integrated -- http://master.php.net/note/delete/68027/integrated
Del: useless -- http://master.php.net/note/delete/68027/useless
Del: bad code -- http://master.php.net/note/delete/68027/bad+code
Del: spam -- http://master.php.net/note/delete/68027/spam
Del: non-english -- http://master.php.net/note/delete/68027/non-english
Del: in docs -- http://master.php.net/note/delete/68027/in+docs
Del: other reasons-- http://master.php.net/note/delete/68027
Reject -- http://master.php.net/note/reject/68027
Search -- http://master.php.net/manage/user-notes.php