Hallo ich bräuchte einmal hilfe folgende preg_replace zeilen in preg_replace_callback umzuwandeln:
wäre nett wenn ihr mir helfen könntet
Code:
$text = preg_replace('#(^|[\n ])((http|https|ftp|ftps)://[\w\#$%&~/.\-;:=,?@\[\]\(\)+]*)#sie', "'\\1<span style=\'white-space:nowrap;\'>".$icon." <a href=\"'.trim('\\2').'\" target=\"_blank\" ><b>Link</b></a></span>'", $text); $text = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]\(\)+]*)#sie", "'\\1<span style=\'white-space:nowrap;\'>".$icon." <a href=\"http://'.trim('\\2').'\" target=\"_blank\" ><b>Link</b></a></span>'", $text); $text = preg_replace('#\[b\](.*?)\[/b\]#si', '\1', $text); $text = preg_replace('#\[i\](.*?)\[/i\]#si', '\1', $text); $text = preg_replace('#\[u\](.*?)\[/u\]#si', '\1', $text); $text = preg_replace('#\[s\](.*?)\[/s\]#si', '\1', $text); $text = preg_replace('#\[center\](.*?)\[/center\]#si', '\1', $text); $text = preg_replace('#\[left\](.*?)\[/left\]#si', '\1', $text); $text = preg_replace('#\[right\](.*?)\[/right\]#si', '\1', $text); $text = preg_replace('#\[quote\](.*?)\[/quote\]#si', '\1', $text); $text = preg_replace('#\[small\](.*?)\[/small\]#si', '\1', $text); $text = preg_replace('#\[small2\](.*?)\[/small2\]#si', '\1', $text); $text = preg_replace('#\[big\](.*?)\[/big\]#si', '\1', $text); $text = preg_replace('#\[alt\](.*?)\[/alt\]#si', '\1', $text); $text = preg_replace('#\[code\](.*?)\[/code\]#si', '\1', $text); $text = preg_replace('#\[think\](.*?)\[/think\]#si', '\1', $text); $text = preg_replace('#\[color=([\#a-f0-9]*?)\](.*?)\[/color\]#si', '\2', $text); $text = preg_replace('#\[bcolor=([\#a-f0-9]*?)\](.*?)\[/bcolor\]#si', '\2', $text); $text = preg_replace('#\[size=(12|16|20|24|28|32)\](.*?)\[/size\]#si', '\2', $text); $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie", "BILD", $text);
Kommentar