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:[EMAIL PROTECTED]]
Sent: 20 March 2001 14:08
To: Php-General
Cc: Thorsten Viel
Subject: RE: [PHP] Easy Object Reading
-Original Message-
From: Thorsten Viel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 March 2001 00:59
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]