Re: Echo array string index?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux