views:

87

answers:

3

Hello, everybody!!!

Would you, please, tell me what command (or a combination of those) in PHP would check a web-page by its URL and possibly download its code (HTML) into a variable? Well, I was suggested to use Goggle App Engines for this here, but I am also quite q curious about how much of that task can PHP perform.

+1  A: 

You could use curl. Here is a tutorial

David Archer
+6  A: 
$f = file_get_contents('http://www.google.com');

http://php.net/file_get_contents

Peter Lindqvist
+2  A: 

Hello First Visit this webpage file-get-contents.

If you think the above is to complex use a library PHP Simple HTML DOM Parser download here PHP Simple HTML DOM Parser

And Finaly here is the code

<?php
include_once 'simple_html_parser.php';

$html = file_get_html('http://www.google.com/');

// Find all images
foreach($html->find('img') as $element)
       echo $element->src . '<br>';

// Find all links
foreach($html->find('a') as $element)
       echo $element->href . '<br>'; 
?>
streetparade
Thank you very much!
brilliant