How can I get data from another web page into PHP?
Can I retrieve an external web page using PHP?
Jul 2nd, 2000 16:56
Philip Olson, Nathan Wallace, Jim Winstead, Manual Lemos
You can download a web page from another site using
But you should look at whether that site allows you to do what you want.
It may not if they make their money by serving up banner ads on the
pages they serve up for you.
If you need to get the page via a proxy or using POSTed forms, check
Another way to do it is this :
$url = 'http://www.iloveyoursite.com/index.php';
$lines_array = file($url);
$lines_string = implode('', $lines_array);
eregi("<html>(.*)</html>", $lines_string, $mydata);
$url = the site your gathering your data from
$mydata = the newly harvested data
<html> and </html> are the first and last items on the $url, you can
replace this with anything. like, if you're wanting their body you may
choose <body> and </body> or anything works...doesn't have to be an
html tag, just a beginning and end. of course these should actually
exist within the $urls page.
this will put the page within your website quite nicely and have fun!