现成的不是有吗?晕人。
blog.csdn.net/kingerq
进去看看,好多好用的东西 。

解决方案 »

  1.   

    取左边多少字符之类的。。
    substr
      

  2.   

    function Txt2Html($str1) {
          $s = '';
          if(empty($str)){
              return $s;
          }      $s = str_replace(' ', ' ', $str );
          $s = str_replace('<','&lt;',$s);
          $s = str_replace('>','&gt;',$s);
          $s = str_replace(chr(13),'<br>',$s);
          
          return $s;
      }这个函数为什么不对?返回值是空
      

  3.   

    yeah ..收藏blog.csdn.net/kingerq
      

  4.   

    看到了。str1 写成  str 了。