Re: Printing sub objects/2 dimensional arrays
| From: | Ignacio Vazquez-Abrams | Date: | Fri, 24 Nov 2000 17:20:41 +0000 |
| Subject: | Re: Printing sub objects/2 dimensional arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26979@lists.php.net to get a copy of this message | ||
On Fri, 24 Nov 2000, Folke Ashberg wrote:
> Hi!
> Printing a lot sub objects is very exhausting because you have to append
> all objects doing
> print $foo->bar->foobar." is foo<BR>\n and ".$foo->bar->xyz."
> also<BR>\n";
>
> Isn't there a possibility to use only
>
> print "$foo->bar->foobar is foo<BR>\n and $foo->bar->xyz
> also<BR>\n";
>
> PHP will output
> Object->foobar is foo
> and Object->xyz also
>
> The same problem using 2dimensional arrays
> print "$foo[bar][xyz] and the string goes on..";
>
> regards
>
> Folke
>
Try puting the variable in braces (i.e., "{" and "}").
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>