You are here: Re: Access values within class within array « PHP Programming Language « IT news, forums, messages
Re: Access values within class within array

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация