file_get_contents() will read the whole file while filesize() uses stat() to determine the file size. Use filesize(), it should consume less disk I/O and much less memory.
file_get_contents() will read the whole file while filesize() uses stat() to determine the file size. Use filesize(), it should consume less disk I/O and much less memory.