Page 1 of 1

process/save webpage from list of links

Posted: Thu Jul 28, 2005 6:50 pm
by jaymoore_299
If I have a link, how do I save that webpage source in a file using php without displaying it?

I also want to be able to process a webpage so that I could modify it then send the output to the browser.

How do I do this?[/u]

Posted: Thu Jul 28, 2005 7:03 pm
by timvw
file_get_contents and the http(s) stream wrappers enabled it's a breeze...

Code: Select all

$file = file_get_contents('http://timvw.madoka.be/thief.php');

// store file (php5 only function)
file_put_contents('thief.txt', $file);

// convert to lowercase and display
echo strtolower($file);