I'm trying to extract all the links that comes from after a specific user, But my regex only grab one link:
HTML:
<div class="from_name">
USERNAME
</div>
<div class="media_wrap clearfix">
<div class="media clearfix pull_left media_photo">
<div class="fill pull_left">
</div>
<div class="text">
<a href="https://google.com</a>
</div>
</div>
<div class="text">
<a href="https://yahoo.com</a>
</div>
</div>
Codes:
preg_match_all('/USERNAME[\s\S]*?href="(.*?)</', $data, $matches);
print_r($matches);
//output, it's only caputre google.com :
Array
(
[0] => Array
(
[0] => FullCapture
[1] => Array
(
[0] => https://google.com
)
)