Replacing url in a string with working ones using PHP

But displays “Array” as a link to the page. What to fix? Is there any alternative?

Answer 1, authority 100%

$msg= str_replace($urls[0][$i], '<a href="'.$urls[0][$i].'">'.$urls[0][$i].'</a>' , $msg);

But in general, your regular expression is crooked) I recommend this resource

Leave a reply

Please enter your comment!
Please enter your name here