$1', '
Copy codeThe code is as follows: The above introduces the function of hyperlink font color in PHP to convert a URL into a hyperlink, including the content of hyperlink font color. I hope it will be helpful to friends who are interested in PHP tutorials.
Hyperlink font color function in php to convert URL to hyperlink
function showtext($text){
$search = array('|(http://[^ ]+)|', '|(https://[^ ]+)|', '|(www.[^ ]+)|');
$replace = array('$1', '$1', '$1');
$text = preg_replace($search, $replace, $text);
return $text;
}