Posted by Andy Jeffries on 06/21/06 15:32
On Wed, 21 Jun 2006 15:26:39 +0000, Shawn Hamzee wrote:
> What is the syntax to access _my_id and _my_name in for loop.
>
> I have this but it doesn't work:
> -for ($I = 0; $I < count($myarrays_name); $I++) {
> print $myarrays_name[$I]=>Classes->_my_id
> }
for ($I = 0; $I < count($myarrays_name); $I++) {
print $myarrays_name[$I]->_my_id;
}
or simpler:
foreach ($myarrays_name as $obj) {
print $obj->_my_id;
}
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|