file_get_contents — Reads entire file into a string
This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.
file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?php $url = "www.google.com"; $auth = base64_encode(':'); $aContext = array( 'http' => array( 'proxy' => 'tcp://:', 'request_fulluri' => true, 'header' => "Proxy-Authorization: Basic $auth", ), ); $cxContext = stream_context_create($aContext); $sFile = file_get_contents($url, False, $cxContext); echo $sFile; ?> |
Note: Change user, pass, proxy and port according to you in the above example.