Can anyone advise on what is the best PHP function for displaying an image stored in a filesystem - file_get_contents or readfile. We are switching
file_get_contents
readfile
I would do something like:
header('Content-type: image/jpeg'); readfile('something.jpg');
readfile() seems more useful for this purpose as it reads a file and writes it to the output buffer returning the number of bytes read from the file, or false on an error.