Forum Moderators: coopster
to load my .pmf file each line is a photo and a comment,
./imgs/image1.jpg /*/*/ Me Sking - Oh What Fun
./imgs/image2.jpg /*/*/ The Alps In All There Glory
so how do i do a foreach line in this file and how do i then split up my varables? i think it is something like
$file = file("photos.pmf")foreach($line ($file)){
link($var1,$var2) = split("/*/*/", $line);
echo "<img src='".$var1."' atl='".$var2."' />".$var2."";
}
but i am not sure hence the asking for help, thanks in advance.
Alan
<?php
$lines = file('photos.pmf');foreach ($lines as $line_num => $line)
{
$tmp = explode('/*/*/', $line);
$file = $tmp[0];
$title = $tmp[1];
echo '<img src="dir/to/images/'.$file.'">'.$title.'<br />';
}
?>
I chose explode as personal preference you should be able to use split if you prefer.
Good luck
Del