Reply to Re: Newbie Question on Accessing Arrays via Index Key

Your name:

Reply:


Posted by Steve on 09/24/07 21:15

"Vik Rubenfeld" <vikr@mindspring.com.invalid> wrote in message
news:vikr-654091.14030624092007@earthlink.vsrv-sjc.supernews.net...
>I got it figured out. I was reading in the string I was using for the
> index, from a CSV file, and it came in with the double-quotes still
> around it. So instead of accessing $array[1001], I was accessing
> $array["1001"].

either way, i always suggest using foreach constructs for iteration since
that makes this problem disappear...and, should a key/index be unset/missing
in your array, foreach won't blow up and iterate over all elements, rather
than the ones you 'think' should be there.

but that could just be me and my 0.02 usd.

[Back to original 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

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