I have this html data and I am trying to extract the first href value from the below div element.
<div>blah blah.
<a href="http://www.example.com">example</a>
<a href="http://www.example2.com">site</a>
</div>
I tried using this regex, but I can't figure out where I am going wrong?
preg_match('/<div>.*?<a.*"(.*)">/', $html, $match);
Could someone suggest a better approach?