Tuesday, 17 September 2013

How to use preg_match_all according to url?

How to use preg_match_all according to url?

I want to find all about a href tags that include my url in any html source.
I use this code :
preg_match_all("'<a.*?href=\"(http[s]*://[^>\"]*?)\"[^>]*?>(.*?)</a>'si",
$target_source, $matches);
Example, I try to find a href tags that include http://www.emrekadan.com
How can I do it ?

No comments:

Post a Comment