That worked well, just had to fix my mistake of naming image files with .txt extensions instead of .gif!
I do have one more question though. How do I add in the imagesperrow = 2 I have tried below but that doesn't work so any advice you have would be terrific!
<?
$name = $row_rs_dgame['name'];
$name2 = str_replace(' ', '', $name);
$path_array['imagefileanim'] = 'images/' . $name2 . '/' . $name2 . '/moving/' . $name2 . '_Anim_1.gif';
for ($i = 1; $i <= 4; $i++)
{
$path_array['imagefile' . $i] = 'images/' . $name2 . '/' . $name2 . '/screenshots/' . $name2 . '_' . $i . '.gif';
}
foreach ($path_array as $key => $value)
{
if (file_exists($value))
{
$imagesperrow=2;
$imagesperrow=$value
echo '<img src="'.$value.'">';
}
else
{
echo 'The file ' . $value . ' does not exist<br>';
}
}
?>