How do I write a file_exists with an array?
I have this code:
for ($i = 1; $i <= 4; $i++)
{
$path_array['imagefile' . $i] = 'images/' . $name2 . '/' . $name2 . '/screenshots/' . $name2 . '_' . $i . '.gif';
}
echo $path_array[0]['imagefile' . $i] = 'images/' . $name2 . '/' . $name2 . '/screenshots/' . $name2 . '_' . $i . '.gif';
How do i use file_exists?
if (!file_exists($path_array[0]['imagefile' . $i] = 'images/' . $name2 . '/' . $name2 . '/screenshots/' . $name2 . '_' . $i . '.gif'))
Is the above right? It seems rather messy. How can I streamline this?
I'd like to do an if else to check if each of the returned files exists. Is there anyway to do that without repeating this code over and over?
Thanks