Retrieve a page and save it in a variable with fopen.
Today I have found this little snippet to retrieve a page to save it in a variable e.g. $content.
$handle = fopen($location, "r"); if($handle) { $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);
You want to know what the 8192 does? It’s the byte data the browser retrieves before saving it into $contents.
Like our posts? Then subscribe via Mail:
Similar Posts:
- Find occurences of multiple needles in haystack
- Creating a popup window
- Move Wordpress Blog To A New Host Or Domain
- Unblockable Pop Under Script
- GET URL parameter via Javascript
Socialize:
|
|











Leave your response!