Hey there,
Ive been breaking my head on this for 2 days now 🙁
Nomatter what i try this line isnt getting translated:
$text=preg_replace("/\[url\=(\w+:\/\/)(\S+)\](\S+)\[\/url\]/is","<a href='$1$2' target='_blank'>$3</a>",$text);
Its for a titled BBcode WITH http in the typed url.
I made similiar lines:
function BBCode($text) {
//url with tags, without http://
$text=preg_replace("/\[url\=(www\.)(\S+)\](\S+)\[\/url\]/is","<a href='http://$1$2' target='_blank'>$3</a>",$text);
$text=preg_replace("/\[url\](www\.)(\S+)\[\/url\]/is","<a href='http://$1$2' target='_blank'>$2</a>",$text);
//url with tags, with http://
$text=preg_replace("/\[url\=(\w+:\/\/)(\S+)\](\S+)\[\/url\]/is","<a href='$1$2' target='_blank'>$3</a>",$text);
$text=preg_replace("/\[url\](\w+:\/\/)(\S+)\[\/url\]/is","<a href='$1$2' target='_blank'>$2</a>",$text);
return $text;
}
The faulty line is threre too, but the rest seems to work alright.
Just that line isnt 🙁
can anyone have a look at it and see whats wrong with it?
Thanks!