preg_match_all("~(http://[^ ]+)~", $msg, $urls); //ищу подстроки url for ($i=0; $i< count($urls[0]); $i++) { $msg= str_replace($urls[$i], '<a href="'.$urls[$i].'">'.$urls[$i].'</a>' , $msg); } //пытаюсь заменить их на рабочие с помощью <a>
But displays on the "Array" in the form of links. What to fix? Can there be any alternative?