Array bbcode

i created chat but how to create /me command?
i want get: <i>content</i>
when type: /me then the message = content

<?
function bb2html($text)
{
  $bbcode = array("<", ">",
				":)",
				# for /me
				"/me",
				# for /me
                "[u]", "[/u]", 
                "[i]", "[/i]",
                '[url="', "",
                '"]');
  $htmlcode = array("<", ">",
				"<img src=\\"/pic/smile.gif\\" alt=\\":)\\" />",
				# for /me
				"<i>", "</i>",
				# for /me
                "<u>", "</u>",
                "<i>", "</i>",
                '<a href="', "</a>",
                '">');
  $newtext = str_replace($bbcode, $htmlcode, $text);
  $newtext = nl2br($newtext);//second pass
  return $newtext;
}
?>

i think i need add before $newtext if array /me -> <i>content</i> but i dont know how…

why not just do a str_replace(“/me”, “<i>content</i>”, $newtext);

amm… how to make
$text = ‘/me likes cheese’;
become
$text = ‘<i>likes cheese</i>’;


<?php

$userInput = "/me likes cheese";

$text = str_replace("/", "\\/", $userInput);
$find = "/me";

if(strpos($text,$find)) {
   echo "<i>".stristr($text, " ")."</i>";
}

?>

thanks !