You need a regular expression, and better code directly (if it doesn’t make it difficult for you) to replace:

/текст<br />

on

<b>текст</b>

Thanks in advance for the help!

    2 answers 2

    Kakto logic in the issue is not enough, but oh well.

     $str = "/текст<br />"; if(preg_match("#\/(.*)<br \/>#", $str)) { $str = preg_replace("#\/(.*)<br \/>#", "<b>$1</b>", $str); } echo $str; 
       <?php $txt = "/текст<br />"; $txt = str_replace("/","<br>",$txt); echo($txt); ?> 

      So try
      Only better instead / use for example -b- or _b_