Date: 07/31/02
- Next message: Nick Wilson: "Re: [PHP] I need some help: PHP portal site/creating email accounts through form submission"
- Previous message: Nick Wilson: "[PHP] extracting variables from files"
- In reply to: Marty McGowan: "[PHP] Printing a PHP Class"
- Next in thread: Jerome Houston: "Re: [PHP] Printing a PHP Class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Maybe code will help...
> My problem is:
> when printing the Class Variables using the "standard" approach:
> =========
> function print_vars($obj) {
> $arr = get_object_vars($obj);
> while (list($prop, $val) = each($arr))
> {
> echo "$prop\t$val\n";
> }
> }
> =========
Try this:
function print_vars($obj)
{
$arr = get_object_vars($obj);
while (list($prop, $val) = each($arr))
{
if(is_array($val))
{ echo "$prop\t" . implode(",",$val) . "\n"; }
else
{ echo "$prop\t$val\n"; }
}
}
---John Holmes...
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Nick Wilson: "Re: [PHP] I need some help: PHP portal site/creating email accounts through form submission"
- Previous message: Nick Wilson: "[PHP] extracting variables from files"
- In reply to: Marty McGowan: "[PHP] Printing a PHP Class"
- Next in thread: Jerome Houston: "Re: [PHP] Printing a PHP Class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

