Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Reading Data from File HELP!
January 17, 2005, 2:47 am
rate this thread
caption is on a new line. I read the string from each line, up until the
line break (\r\n) and then assume my fields are starting again on the
new line. It all works fine, except for the whole thing to work
properly, i need a line break on the last line of the file, causing the
image display to show a broken image... is it possible to ignore a line
if it has nothing in it.. something like an if null statement or
Here's the bit of the file that spits out the contents of the file...
the file is in format "filename.jpg|caption of file" (without the quotes)
$data = file($file);
foreach ($f as $o)
print "<input type=radio name=line value=$o>";
$g = $o;
list ($q, $a) = explode('|' , trim($g) );
echo "<img src='images/$q' height=100><br><br>";