i have this PHP chatbox.
If i would type a link in the chatbox, it would not display it as a link.
How can i use STR replace to do this?
It should re
You should use regex instead. look at preg_replace
$regex = '`(\s|\A)(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)`ism'; $replace = '$1$2://$3$4' $buffer = preg_replace($regex,$replace,$buffer);