You can use cURL to grab a webpage, and you may parse it with any regular expression you wish ! http://www.php.net/manual/en/book.curl.php
Rodolphe
2010-05-03 07:49:19
You can use cURL to grab a webpage, and you may parse it with any regular expression you wish ! http://www.php.net/manual/en/book.curl.php
You could use file_get_contents
Straight from php.net
<?php
$homepage = file_get_contents('http://www.example.com/');
echo $homepage;
?>
As Rodolphie already said, using cURL is possibly the best way to fetch a remote page. You really don't need to use regexp to check if the text contains a string, this will do it:
if (strpos($urlContents, $needle) !== FALSE) {
echo "match found";
}