note 46745 deleted from function.print-r by sean
| From: | sean@php.net | Date: | Thu, 21 Oct 2004 23:24:14 +0000 |
| Subject: | note 46745 deleted from function.print-r by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78915@lists.php.net to get a copy of this message | ||
Note Submitter: killar at gamingsanctum dot com
----
When printing an array, NEVER FORGET THE <pre> TAGS. If you do not use them, you will get a
printout of the entire array on one line.
Example:
<?
$test123 = array('the', 'wrong', 'way');
print_r($test123);
?>
Will give
Array ( [0] => the [1] => wrong [2] => way )
While:
<?
$test123 = array('the', 'right', 'way');
echo '<pre>';
print_r($test123);
echo '</pre>';
?>
Will give:
Array
(
[0] => the
[1] => right
[2] => way
)
Keep that in mind. It really helped me with debugging.
----
Reason: useless note