RE: [PHP] Easy Object Reading

From: Date: Tue, 20 Mar 2001 14:28:21 +0000
Subject: RE: [PHP] Easy Object Reading
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44752@lists.php.net to get a copy of this message
If you don't want to dump this to the screen but would prefer to have this in a string (to send to a log file etc..) then use the following function: function getStringFromObject($prmAryIn) { // Following code was ripped from http://www.php.net/manual/en/function.var-dump.php // it's very nice indeed!! ob_start(); var_dump($prmAryIn); $output = ob_get_contents(); ob_end_clean(); return $output; } -----Original Message----- From: Grant Walters [mailto:Grant.Walters@walters.co.nz] Sent: 20 March 2001 14:08 To: Php-General Cc: Thorsten Viel Subject: RE: [PHP] Easy Object Reading > -----Original Message----- > From: Thorsten Viel [mailto:tviel@hw-interactive.de] > Sent: Wednesday, 21 March 2001 00:59 > To: php-general@lists.php.net > Subject: [PHP] Easy Object Reading > > > Hi, > > does somebody know a function where I can read all variables of an object > independent of there name? > > I have to test with large classes, more than 30 vars per class, and dont > want to implement a function just for testing. > I want to echo all values of vars of a class without specifyieng > explicitly > every single varname. > var_dump(PHP3 >= 3.0.5, PHP4 ) Dumps information about a variable void var_dump (mixed expression) This function returns structured information about an expression that includes its type and value. Arrays are explored recursively with values indented to show structure. Compare var_dump() to print_r(). 1 2 <pre> 3 <?php 4 $a = array (1, 2, array ("a", "b", "c")); 5 var_dump ($a); 6 ?> 7 </pre> 8 Regards Grant Walters Brainbench 'Most Valuable Professional' for Unix Admin Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#44752) next »