include("include/nl2p.php");
//nl2p处理POST过来的文本信息,把换行转换为
//去除标签,把'替换为"
$text1=str_replace('\'','"',nl2p(htmlspecialchars($_POST["text1"],false)));
}
?>
//显示在textarea
echo "";
echo substr(str_replace("
","\n",$text),3,-4);
echo "";
?>
//include/database_conn.php
function nl2p($string)
{
//$string = str_replace(array('
', '
', '', '
'), '', $string);
return '
'.str_replace (array("\r\n","\n","\r"), '
', $string).'
';}
?>