Posted By

digdan on 09/11/08


Tagged

spidercrawlhrefhtmlparse


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


Find Links in HTML


 / Published in: PHP
 

Will find all links in a given string containing html

  1. <?
  2. function return_links($in_string) {
  3. preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", in_string, $matches);
  4. return $matches;
  5. }
  6. ?>

Report this snippet  

You need to login to post a comment.