Re: iterating through object structure
- From: Good Man <heyho@xxxxxxxxxx>
- Date: Wed, 31 Oct 2007 11:34:52 -0500
JamesG <mailmehere@xxxxxxxxx> wrote in news:1193843101.021717.143420@
19g2000hsx.googlegroups.com:
Hi,
I have a data structure as follows (print_r($data)):
Array
(
[0] => stdClass Object
(
[FIELD1] => 2355
[FIELD2] => 123
[FIELD3] => 1.25
)
[1] => stdClass Object
(
[FIELD1] => 309
[FIELD2] => 122
[FIELD3] => 0.55
)
)
I can't seem to iterate through it,
If I try
foreach($data as $obj) {
echo $obj->FIELD1 + $obj->FIELD2;
}
It only shows the first object, not the rest. What am I doing wrong?
Using a '+' instead of a '.' ?
.
- Follow-Ups:
- Re: iterating through object structure
- From: Rik Wasmus
- Re: iterating through object structure
- References:
- iterating through object structure
- From: JamesG
- iterating through object structure
- Prev by Date: Re: Multiple Domains; 1 Server; 1 PHP Install; Only One Domain Has A Working PHP; WHY??????
- Next by Date: Re: register_globals on / off - I think I'm missing the point
- Previous by thread: iterating through object structure
- Next by thread: Re: iterating through object structure
- Index(es):
Relevant Pages
|