Answers for "php linkify text"

PHP
0

php linkify text

$string = "Look on http://www.google.com";
$string = preg_replace(
              "~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~",
              "<a href=\"\\0\">\\0</a>", 
              $string);
Posted by: Guest on May-28-2020

Browse Popular Code Answers by Language