来自html表单textarea的换行符(\ n)???救命! [英] Line breaks (\n) from a html form textarea??? HELP!

查看:418
本文介绍了来自html表单textarea的换行符(\ n)???救命!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个带有textarea的HTML表单。提交时(使用''get''

而不是''post'')这个表单操作php文件只是为了检索

值:


$ message = $ _GET [" message"];


现在一切正常,但我在一个长字符串中得到字符串,没有

''\ n''用户按下''返回键''

如何在textarea中获取回车以用
a''\ n''???它让我疯狂!

Hi

I have an HTML form with a textarea on it. When submitted (using ''get''
not ''post'') this forms action php file simply does this to retrieve the
values:

$message = $_GET["message"];

Now it all works fine but I get the string in one long string with no
''\n'' where the user pressed ''return key''

How can I get the carriage returns in the textarea to be replaced with
a ''\n'' ??? Its driving me nuts here!!

推荐答案

message =
message =


_GET [" message" ;];


现在一切正常但我在一个长字符串中得到字符串没有

''\ n''用户按下了''返回键''


我如何在textarea中获得回车以取代

a''\ n''???它让我疯狂!!

_GET["message"];

Now it all works fine but I get the string in one long string with no
''\n'' where the user pressed ''return key''

How can I get the carriage returns in the textarea to be replaced with
a ''\n'' ??? Its driving me nuts here!!


消息ID:< 11 ***************** *****@s34g2000cwa.googlegroups .comfrom

ghostwalker包含以下内容:
Message-ID: <11**********************@s34g2000cwa.googlegroups .comfrom
ghostwalker contained the following:

>我有一个带有textarea的HTML表单在上面。提交时(使用''get''
而非''post'')这个表单动作php文件只是为了检索
值:

>I have an HTML form with a textarea on it. When submitted (using ''get''
not ''post'') this forms action php file simply does this to retrieve the
values:


这篇关于来自html表单textarea的换行符(\ n)???救命!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆