I would suggest changing file_exists()
to is_file
and I'd suggest moving your file_get_contents
to just after that, and put the value in a variable like
$contents=file_get_contents("downloaded2/PisaTower/$entry.exif.txt");
That way you don't have to keep reading from the disk (or network)
Then, I'd suggest
$lines=explode(' : ',$contents);
foreach($lines as $line)
{
echo $line."\n<br>";
}
Notice that I used double quotes "
at the end of the echo. That allows the newline \n
to be parsed.