mmm, strange that my code didn't worked, cause it works fine here.
You user
right?? Else try this:
<?php
$text = "Bla bla [image]http://www.blah.com/image.jpg[/image]";
$text = bbcode($text);
echo $text;
function bbcode($edit) {
$edit = preg_replace("#[image](http(s)?://)([a-zA-Z0-9-.,?!%*_#:;~\&$@/=+]+)[/image]#", "<img src=\"\1\3\" border=\"0\">", $edit);
return $edit;
}
?>
You have to place an image between [image]link_to_image[/image] tags 🙂