Readfile will read the file directly into the output buffer, and file_get_contents will load the file into memory, when you echo the result the data is copied from memory to the output buffer effectively using 2 times the memory of readfile.
More Related Contents:
- What does \n mean [duplicate]
- How i can earn variable from string in PHP? [closed]
- PHP function to generate v4 UUID
- What in layman’s terms is a Recursive Function using PHP
- Recursive function to generate multidimensional array from database result
- PHP echo vs PHP short echo tags
- What is the difference between PHP echo and PHP return in plain English?
- How do I find the mime-type of a file with php?
- Is it possible to overwrite a function in PHP
- How do I immediately execute an anonymous function in PHP?
- How to copy a file from one directory to another using PHP?
- Equivalent of include() in HTML
- Is it possible to replace a function in php (such as mail) and make it do something else?
- PHP Array Syntax Parse Error Left Square Bracket “[” [closed]
- Delete digits after two decimal points, without rounding the value
- How do I remove the URL protocol and slash from user input in PHP
- PHP function flags, how?
- How to use include within a function?
- Multiple excerpt lengths in wordpress
- Get the hierarchy of a directory with PHP
- Accept function as parameter in PHP
- The advantage / disadvantage between global variables and function parameters in PHP?
- PHP: variable not working inside of function?
- Is it possible to visualize a bunch of functions in UML
- What Does Using A Single Pipe ‘|’ In A Function Argument Do?
- How to get last insert Id in SQLite?
- Override default php function
- PHP Optional Parameters – specify parameter value by name?
- When to use a Class vs. Function in PHP
- How can you use php in a javascript function [duplicate]