System resources, CPU and memory, can be quickly consumed. This can
lead to poor system performance or system crash.
This data prints the contents of a specified file requested by a
//read file into string
$file = file_get_contents($filename);
if ($file &&
echo 'You are not authorized to view this file';
This code first reads a specified file into memory, then prints the
file if the user is authorized to see its contents. The read of the file
into memory may be resource intensive and is unnecessary if the user is
not allowed to see the file anyway.