Reply to An endless loop

Your name:

Reply:


Posted by Dave Kelly on 09/14/06 02:36

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'];
}

?>
============#
This code does exactly as expected. It prints to the screen the first
element of the array.

The array is of unknown length. I need to print to the screen all
elements. I have been able to do this with: for loops, while loops, do
loops, and some if statements, the problem is stopping when it reached
an empty element.

Even if I chose an arbitrary number to stop at, it would print the
elements and the balance in error lines.

Anybody have suggestions on how to stop the endless loop?

TIA
Dave

[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

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