Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP文本字段段落_Php_Textfield - Fatal编程技术网

PHP文本字段段落

PHP文本字段段落,php,textfield,Php,Textfield,是否可以在“文本字段PHP”中包含段落,即使用shift-enter输入内容并作为段落提交,然后在文章中显示相应的段落 任何建议都将不胜感激 嗨,脚本是文本字段而不是文本区域 它也是smarty php <?php //retrieve the textarea value, assuming the form has a textarea named "textfield" $text = $_REQUEST['textfield']; //sanitize the text for

是否可以在“文本字段PHP”中包含段落,即使用shift-enter输入内容并作为段落提交,然后在文章中显示相应的段落

任何建议都将不胜感激


嗨,脚本是文本字段而不是文本区域

它也是smarty php


<?php
//retrieve the textarea value, assuming the form has a textarea named "textfield"
$text = $_REQUEST['textfield'];

//sanitize the text for showing it to the user
$sanitized_text = html_entities($text);

//replacing the new lines from text to <br>
$final_text = nl2br($sanitized_text);

//showing the text to the user, with "paragraphs"
echo '<p>'.$final_text.'</p>';
?>

您试过什么吗?你的PHP代码是什么?嗨,脚本是textfield而不是text area。它也是smarty phpHi不,它不是文本区域,这是问题所在,它是文本字段