Code:
<?
$dir = "img/whittingham";
if (is_dir($dir)) {
$fd = @opendir($dir);
if($fd) {
while (($part = @readdir($fd)) == true) {
if ($part != "." && $part != "..") {
$file_array[] = $part;
}
}
}
}
for ($x=0; $x < sizeof($file_array); $x++) {
echo "<img src=\"". $dir."/".$file_array[$x] ."\"><br />";
}
?>
right.. that does what it is supposed to, scans the dir and outputs all the images. now suppose i want to add an alt elemenent to the img tag, surely it would be
Code:
."alt="moo""
meaning the output line is;
Code:
echo "<img src=\"". $dir."/".$file_array[$x] .alt"moo""."\"><br />";
but if i do that, i get a parser error. i'm a newbie at php, and i can't see where i'm going wrong here.