RegEx
| From: | Brian V Bonini | Date: | Mon, 26 May 2003 00:05:21 +0000 |
| Subject: | RegEx | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-148934@lists.php.net to get a copy of this message | ||
Trying to pull data from a remote location and extract a certain section
(and yes I have permission). Can not seem to get this to work:
$siteurl = "http://domain.com";
$string = file($siteurl);
$matches = array();
preg_match_all('|\<\!--***** BEGIN HOME PAGE CONTENT *****
--\>(.*?)\<\!--***** END HOME PAGE CONTENT ***** --\>|is',$string,
$matches);
//see what we have
echo '<pre>';
print_r($matches);
echo '</pre>';
I get:
Array
(
[0] => Array
(
)
[1] => Array
(
)
)