#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    69
    Rep Power
    18
    Hi there!!

    i onece found some code so perl could put all the values in the <a href""> tags in an array, now i was wondering is there is a way for PHP to do the same, i want's to type in an url or some local file, and then php takes all the links and puts them in an array for me, can this be done??

    regards
    Simon
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Melbourne, Victoria, Australia
    Posts
    104
    Rep Power
    14
    There's nothing that can't be done

    You could do it with some regular expressions... like something like this:

    preg_match("/<A.+HREF="(.+)".*>/", $page, $matches);

    then theoretically $matches would be an array of all the urls in <A HREF=""> tags on the page. I haven't tried it so don't stake your life on it...

    Hope that helps,

    Josh

IMN logo majestic logo threadwatch logo seochat tools logo