<?php $text = '[img width=600 height=300]url[/img]'; // here-------------------v // v echo preg_replace("/\[img width=(.*) height=(.*)\](.*)\[\/img\]/Usi", "<img src=\"\\3\" class=\"image\" style=\"width:\\1; height:\\2\" />", $text); echo "\n---\n"; echo preg_replace("/\[img width=(.*) height=(.*)\](.*)\[\/img\]/Usi", "<img src=\"\\3\" class=\"image\" style=\"width:\\1; height:\\2\" />", $text); echo "\n---\n"; echo preg_replace("/\[img width=(.*) height=(.*)\](.*)\[\/img\]/Usi", "<img src=\"$3\" class=\"image\" style=\"width:$1; height:$2\" />", $text);
You have javascript disabled. You will not be able to edit any code.