I really don't know why I can't get some url from some source code from one website with preg_match, maybe it's me doing it wrong, I tried it in so many ways but i can't get it...
The problem is, i'm trying to take only the url from a source code that looks like this:
<h2><a href="http://www.website.com/index.php" h="ID=SERP,5085.1">Website name</a></h2>
So what i want to get to a variable is the http://www.website.com/index.php
I was doing something like this:
preg_match_all('/<h2><a href=".*">/',$text,$m) ;
$text is the source code, its really long website source code so i only want to get the href from tags < a > that are inside tags < h2 > . . . I hope you guys can help me