You are here: Re: An endless loop « PHP Programming Language « IT news, forums, messages
Re: An endless loop

Posted by Erwin Moller on 09/14/06 09:15

Dave Kelly wrote:

> This is a continuation of a previous thread:"Displaying text with
> include file." This is the PHP include file.
>
> I have about googled myself out on this one. If I have found what it is
> I seek , I don't recognize it.
>
> ==========#
> <?php
> $data = file("outing.1.php");
> foreach ($data as $line) {
> $line = explode("_", $line);
> print $line['0'];

That looks strange to me.
You use an associative array notation, when you clearly need a normal index.
$line is an array.
$line[0] contains the first element.
$line[1] contains the second element.
etc

I don't uderstand why you use '0' as index instead of a plain 0.
I am surprised this works at all. ???
Is PHP converting the string '0' to integer 0?

Erwin Moller

 

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

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