I was wondering if there is a way to take a string like
$string = "Look at *me* because I am bold";
and replace the asterisks with tags so the string would be
echo $string; //"Look at <bold>me</bold> because I am bold"
Try $string = preg_replace('~\*(.*?)\*~','<bold>$1</bold>',$string);
Edit: Appended the semicolon I forgot.
Don't roll your own, you'll quickly end up with a bunch of special cases and loads of trouble. Just get yourself a proper Markdown library and move onto something more important.