You can try the following:
<?php $original_file = file_get_contents("http://www.your_domain.com/page"); $stripped_file = strip_tags($original_file, "<a>"); preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", $stripped_file, $matches); ?>
$ matches [0] will contain full A tags; ex: <a href="link">text</a>
$ matches [1] will contain only HREF in A tags; ex: link
Hope this helps you. Hello!
source share