file_get_contents returns an empty string that is 354 bytes long.
- by Kendall Crouch
I'm trying to read the contents of a file and simply getting an empty string. The file exists on the server.
I've tried some test with the following code and get the true to display:
$filename = "includes/blah.php";
$filecontents = file_get_contents($filename, FILE_USE_INCLUDE_PATH);
if ($filecontents === false) {
echo(":FALSE:");
}
else {
echo(":TRUE:");
}
var_dump($filecontents);
The dump displays "string(354)" which is the correct size of the file.
What am I doing wrong?