I am using this code to try and read the values in a text file.
$mapFile = fopen('config/map.txt', 'r') or die ("Can't open config file");
while ($line = fread($mapfile,filesize('config/map.txt')))
{
echo $line;
}
Instead I keep getting this error.
Warning: fread() expects parameter 1 to be resource, null given
I am unsure what I am doing wrong. How can I read the text in the file properly?