RE: [PHP] Pb'lm of Regular Expression
| From: | nate at savingadvice dot com | Date: | Mon, 08 Nov 2004 07:19:45 +0000 |
| Subject: | RE: [PHP] Pb'lm of Regular Expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201493@lists.php.net to get a copy of this message | ||
These MIGHT work... I don't know though (not too good with regex).
<img.+src=\"(.+)\".+>
<a.+href=\"(.+)\".+>
Nate
-----Original Message-----
From: ankur_os@opensols.com [mailto:ankur_os@opensols.com]
Sent: Sunday, November 07, 2004 10:29 PM
To: php-general@lists.php.net
Subject: [PHP] Pb'lm of Regular Expression
Hi to all
My problem is that i want to create one regular expression which can fatch
this
image tag from my site
"<img src=\"https://abc.com/first.php?
site_id=abc&aid=keyin&lid=keyin&ref=&q=\" width=\"1\"
height=\"1\">";
<?php
$value = print_links("http://www.mysite.com");
function print_links($url)
{
$page_contents = file_get_contents("$url");
preg_match_all("/*********/",$page_contents,$match_array);
print "<pre>"; print_r($match_array); print "</pre>";
foreach ($match_array as $entry)
{
print("The image Tag is :");
}
}
?>
Now what regular expression i write so i can fetch the image tag from my
site of
above syntex.And if possible send me the regular expression of fetching
<A href=""</A>
Thnx in Advance.
Ankur Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php