Getimagesize Problem

Hi all, I think it’s only a minor problem but the getimagesize function doesn’t appear to be working in my script. The images are indeed echoing out but without any width and height attributes. Any ideas what I’ve done wrong? :lol:

<?php
$images = explode(",", $row['workImg']);
	foreach($images as $value):
	list($width, $height, $type, $attr) = getimagesize($value);
	echo "<img src=\\"$value\\" $attr />\
";
	echo $width;
	endforeach;

?>

Ooops it was an issue with the file path in the database. For some reason the function doesn’t like the following: /images/example.jpg but instead accepts images/example.jpg. So it doesn’t like the leading slash. Removed the slash in the database and instead added the slash to img tag in the echo as below (should any Googler stumble across this)! Thanks anyway :smiley:

<?php
$images = explode(",", $row['workImg']);
	foreach($images as $value):
	list($width, $height, $type, $attr) = getimagesize($value);
	echo "<img src=\\"/$value\\" $attr />\
";
	endforeach;

?>

The leading slash should take you back to the default root directory, omitting that slash you are looking for a subdirectory of the directory the script is in.