ubb2html?$content = eregi_replace(quotemeta(""),quotemeta("<b>"),$content);
$content = eregi_replace(quotemeta(""),quotemeta("</b>"),$content);

解决方案 »

  1.   

    $content = eregi_replace("[“,”<",$content);
    $content = eregi_replace("]",">",$content);
      

  2.   

    $str ='bold [b]bddd [/b]';while(preg_match('/\[b\](.*)\[\/b\]/',$str))
    {
     $str = preg_replace('/\[b\](.*)\[\/b\]/','<b>\\1</b>',$str);
    }echo $str;
      

  3.   

    $str=preg_replace("/\[b\](.+?)\[\/b\]/is","<b>$1</b>",$str);
      

  4.   

    $re  = "#\[b\]((?!\[b).+|(?R))*\[\/b\]#is";
    $str = "bold [b]bddd [/b]";
    preg_match_all($re, $str, $out);
    print_r($out);