php把文本框回车转换成html换行
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <label> <textarea name="t" id="t" cols="45" rows="5"></textarea> </label> <label> <input type="submit" name="button" id="button" value="提交" /> </label> </form> <?php if($_POST){ echo str_replace(chr(13),'<br>',$_POST['t']); } ?> </body> </html>
文章链接:http://www.phprm.com/base/ff8b04e8f5b663b8b86d960321efcc83.html
随便收藏,请保留本文地址!