note 51905 added to function.print-r
| From: | thetorpedodog | Date: | Thu, 14 Apr 2005 15:27:16 +0000 |
| Subject: | note 51905 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88008@lists.php.net to get a copy of this message | ||
I've got a *much* simpler solution (shamelessly taken from a PHP learning book):
<?php
function formatArray ( $theArray ) {
print '<pre>' ; // you could replace this with <code>, I suppose
print_r ( $theArray ) ;
print '</pre>' ;
} ?>
If you feel that the monospace font (for the array) is unbecoming, simply change it using CSS.
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51905
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51905&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51905&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51905&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51905&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51905&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51905&report=yes
Search -- http://master.php.net/manage/user-notes.php