note 61322 added to function.print-r
| From: | reinder at fake-address dot com | Date: | Tue, 31 Jan 2006 17:09:36 +0000 |
| Subject: | note 61322 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-102771@lists.php.net to get a copy of this message | ||
I always use this function in my code, because most of my functions return an Array or Boolean :
<?php
function printr ( $object , $name = '' ) {
print ( '\'' . $name . '\' : ' ) ;
if ( is_array ( $object ) ) {
print ( '<pre>' ) ;
print_r ( $object ) ;
print ( '</pre>' ) ;
} else {
var_dump ( $object ) ;
}
}
?>
( print_r gives no output on FALSE and that can be annoying! )
----
Server IP: 217.174.203.10
Probable Submitter: 62.163.68.66
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61322
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61322&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61322&report=yes
Search -- http://master.php.net/manage/user-notes.php