To make strong
$regex = "#([]*[])(.*)([]*[])#e";
$text = preg_replace($regex,"('<strong>$2</strong>')",$text);
To Make Images
$regex2 = "#([]![])(.*)([(])(.*)([]![])#e";
$text = preg_replace($regex2,"('<img src=\"$2\" alt=\"\">')",$text);
To Make Italic
$regex5 = "#([]_[])(.*)([]_[])#e";
$text = preg_replace($regex5,"('<i>$2</i>')",$text);
To Make Strick
$regex6 = "#([-])(.*)([-])#e";
$text = preg_replace($regex6,"('<s>$2</s>')",$text);
To put <br > for each empty line.
$text = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "<br>", $text);
Now i want to do these actions :
@
some code
@
Change first '@' with <pre > and last '@' to </ pre>
i can't detect that character is the first character of line!
if both '@' are first character of line,then do change it
And change if Line start with '*.' or '* '(with space after it) , and end with 'enter' or '\n' or '<br>'(end line)
change start , with <li > and end with </li >