I'm facing a really strange problem. I have a file named 'map' with the following contents:
1;'pag1.html'
2;'pag2.html'
3;'pag3.html'
Then I try to read it with the following php code:
Code: Select all
$lines = file('map');
foreach ($lines as $line_num => $line) {
list($num,$filename)=explode(";",$line);
if ($num==2) {
echo file_get_contents($filename);
break;
}
}Code: Select all
file_exists ($filename)Code: Select all
echo file_get_contents('pag2.html')So why I can see the file pag2.html contents if I use file name string but the file doesn't exist if I use the variable $filename ?
Many thank in advance.