Reply to Re: array $_GET

Your name:

Reply:


Posted by OmegaJunior on 02/27/07 22:22

On Tue, 27 Feb 2007 14:08:10 +0100, Mike Roetgers =

<mikeroet@informatik.uni-bremen.de> wrote:

> Sen schrieb:
>> Hi,
>> why:
>> $n =3D count($_GET);
>> for($i=3D0; $i<$n; $i++)
>> {
>> echo $_GET[$i]
>> }
>> Doesn't work?
>> sen
>
> If you open index.php?test=3Dhallo, then you can access the value with=
=

> $_GET['test'].
> Your loop now tries to echo $_GET[0] for example, but you need to echo=
=

> $_GET['test'] in order to see anything. :-)
>
> If you want to walk through an array, use
> foreach ($array as $value)
> {
> echo $value;
> }

The difference can be found in indexed arrays (using numbers) or =

associative arrays (using texts). Using foreach() this difference is =

overcome.



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

[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

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