就把空格之类的去掉啊

解决方案 »

  1.   

    trim($s)
    把字符串两边的空白字符删除
      

  2.   


    //替换掉所有空格
    $a = "f fds fdsaf  fdsafd    fdsa  w fe  f f     fds a   ";
    $s = array(" " => "", " " => "","  "=>""," "=>""," "=>"");
    $b=strtr($a, $s);
    Echo '<textarea style="width:100%;height:200px">',$b,'</textarea>';
      

  3.   

    trim()
    str_replace()
    preg_replace()