Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    48
    Thanks
    28
    Thanked 0 Times in 0 Posts

    get elements by tag name <a>

    Hi,

    I am trying to get all active links from a txt document but I can only get the attribute name i.e the text of the link and not the link it self.

    echo '<ul>';

    foreach ($elements as $kw) {
    echo '<li>'.htmlentities($kw->nodeValue).'</li>';
    }
    echo '</ul>';

    I have tried adding =href to between the '<li>' but not working any ideas?

    Thanks in advance

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,301
    Thanks
    4
    Thanked 204 Times in 201 Posts
    The href attribute should contain the actual link.
    Dave .... HostMonster for all of your hosting needs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •