如何处理 '\n' 

解决方案 »

  1.   

    你想删掉它:unset($s);
    你想输出它:echo $s;
    你想修改它:$s = "";
    你想传递它:$_SESSION['s'] = $s;
    你想记录它:mysql_query("INSERT INTO table SET s='$s'");
    你想屏蔽它://$s;你还想怎的?
      

  2.   

    使用替换成为<br>这个应该是一般的做法吧
      

  3.   

    nl2br(string string)//  Insere quebras de linha HTML antes de todas newlines em uma string 
      

  4.   

    $s = "ssss\nsss\n";
    echo str_replace("\n","<br />",$str);
    这样不就OK了?