file_get_contents( $sOutputFile) read the contents of a file into a string, It will use memory mapping techniques if supported by your OS to enhance performance.
php://input is a read-only stream that allows you to read raw data from the request body. In the case of POST requests, it is preferable to use php://input instead of $HTTP_RAW_POST_DATA as it does not depend on special php.ini directives.
php://input is not available with enctype=”multipart/form-data”. A stream opened with php://input can only be read once; the stream does not support seek operations.
Example #1 Get and output the source of the webpage of a website
$homepage = file_get_contents('http://www.example.com/');
Example #2 Searching within the include_path
$file = file_get_contents('./people.txt', FILE_USE_INCLUDE_PATH);
Example #3 Reading a section of a file
// Read 14 characters starting from the 21st character
$section = file_get_contents('./people.txt', NULL, NULL, 20, 14);
Example #4 Using stream contexts
// Create a stream
$opts = array(
'header'=>"Accept-language: en\r\n" .
$context = stream_context_create($opts);
// Open the file using the HTTP headers set above
$file = file_get_contents('http://www.example.com/', false, $context);
/* Save the uploaded jpg image to file */
file_put_contents( $sInputFileJpgFull, $bData);
Similar to the Unix C unlink() function. A
WARNING level error will be generated on failure.
/*Reads a file and writes it to the output buffer.*/
int readfile ( string
$filename [, bool
$use_include_path = false [, resource
$context ]] )
One way to get an image in textform would be to use base64.