Hi guys,

I'm having a problem with the split function.
It doesn't work like I want it to...
PHP Code:
  1. $msg = str_replace("[B]", '<b>', $msg);
  2.         $msg = str_replace("[/B]", '</b>', $msg);
  3.         $msg = str_replace("[U]", '<u>', $msg);
  4.         $msg = str_replace("[/U]", '</u>', $msg);
  5.         $msg = str_replace("[I]", '<i>', $msg);
  6.         $msg = str_replace("[/I]", '</i>', $msg);
  7.         $msg = str_replace('\\', '', $msg);
  8.         $urlmsg = @split('[URL="', $msg);
  9.         #$msg = $urlmsg[0];
  10.         if ($urlmsg !== false){
  11.             echo $urlmsg;
  12.             $urlmsg = split('"]', $urlmsg);
  13.             $url = $urlmsg;
  14.             $urlmsg = split('[URL="'.$url.'"]', $msg);
  15.             $urlmsg = split('[/URL]', $msg);
  16.             $msg = str_replace('[URL="'.$url.'"]'.$urlmsg.'[/URL]', '<a href="'.$url.'">'.$urlmsg.'</a>', $msg);
  17.         }
  18.         $img = @split('[IMG="', $msg);
  19.         if ($img !== false){
  20.             $imgurl = split('"]', $img);
  21.             $msg = str_replace('[IMG="'.$imgurl.'"]', '<img src="'.$imgurl.'" />', $msg);
  22.         }
This code converts bbcode into html.
With slight syntax changes this would work for me in VB, but somehow PHP is a little more stubborn to my side...

Anyone?
Thanks in advance