how to make a link to text

Discussion in 'PHP' started by w47w47, Nov 4, 2009.

  1. #1
    also change this:

    <a href="http://sdfsd.com/dfdd.html">sdsfsd</a>

    to this:

    http://sdfsd.com/dfdd.html

    also... for all the links found in a variable.
     
    w47w47, Nov 4, 2009 IP
  2. emilybarbie

    emilybarbie Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $text='.....';
    echo html_entity_decode($text);
     
    emilybarbie, Nov 5, 2009 IP
  3. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    that doesn't solves it. i need to remove them completely.
     
    w47w47, Nov 5, 2009 IP
  4. TSH-Nathan

    TSH-Nathan Greenhorn

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #4
    This should do the trick:

    http:// www. php.net/manual/en/function.htmlentities.php
     
    TSH-Nathan, Nov 5, 2009 IP
  5. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i have to remove this too: <a href=""> </a>

    because if i remove only http:// and www. then the hyperlink will be invalid.

    also what i need is something like: preg_match_all <a.*href="(.*)".*</a>

    just to keep: (.*)

    i just can't figure it out for the right regex... don't know why the one above doesn't work for me. :S

    hmm..... now i saw that i use preg_match_all lol... maybe i need preg_replace will try this. :>
     
    w47w47, Nov 7, 2009 IP