$text是需要显示的文本
$textToOutput is the returned text from nl2br and htmlentities so it can be safety displayed in the html context. ENT_QUOTES将同时转换双引号和单引号,所以您不会遇到这些问题。
//here is the pull from the form
$your_form_text = $_POST['your_form_text'];
//line 1 fixes the line breaks - line 2 the slashes
$your_form_text = nl2br($your_form_text);
$your_form_text = stripslashes($your_form_text);
//email away
$message = "Comments: $your_form_text";
mail("destination_email@whatever.com", "Website Form Submission", $message, $headers);
i am using this two method steps for preserve same text which is in 文字区 to store in mysql
and at a getting time i can also simply displaying plain text.....