本帖最后由 a291121289 于 2009-10-31 07:02:42 编辑

解决方案 »

  1.   

    是这个意思吗?$p = array('/(<).*?(>)/', '/(\[).*?(\])/');
    $thread['shortmsg'] = ' <font color=black>ffg</font>';
    $a = preg_replace($p, '', $thread['shortmsg']);
    print_r($a);
    echo "\n";
      

  2.   

    $thread['shortmsg'] = '<font color=black>'.preg_replace('/\ <\/?[a-z]{1,10}.{0,10}\>/is','',$thread[message]).'</font>';$thread['shortmsg'] = '<font color=black>'.preg_replace('/\ [\/?[a-z]{1,10}.{0,10}\]/is','',$thread[message]).'</font>';
    请问这两个怎么合起来,我单独用分别可以排除换行符和[]里的内容(包括符号)
      

  3.   

    $thread['msg'] = "<font color=black\n>ffg</font>";
    $thread['shortmsg'] = preg_replace('/<.*?>|\[.*?\]/s', '', $thread['msg']);