You are here: Re: [PHP] Echo array string index? « PHP « IT news, forums, messages
Re: [PHP] Echo array string index?

Posted by Ben-Nes Yonatan on 10/21/37 11:22

Matt Darby wrote:
> I have an array setup as such: *$arr['generated text']='generated number';*
>
> What would be the best way to echo the key in a loop?
> Seems pretty easy but I've never attempted...
>
> Thanks all!
> Matt Darby
>

Unless I didnt understood you.. you can easily use foreach() for that.
If you want to loop over it again and again and echo it inside you can
also just make a for() loop and in it make print_r(), if you want to use
the values of the array inside the for() you can again use foreach()
inside it just remember that after the foreach() end you need to do
reset() to the array to repeat the process again with the for().

Cheers,
Ben-Nes Yonatan

 

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

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