Replace URLs in text with HTML links

后端 未结 17 2073
栀梦
栀梦 2020-11-22 11:27

Here is a design though: For example is I put a link such as

http://example.com

in textarea. How do I get PHP t

17条回答
  •  无人共我
    2020-11-22 11:50

    Here is the code using Regular Expressions in function

    $1', '$1');
    
    return preg_replace($find,$replace,$str);
    }
    //Function testing
    $str="www.cloudlibz.com";
    $str=MakeUrls($str);
    echo $str;
    ?>
    

提交回复
热议问题