\ n不起作用 [英] \n doesn't work

查看:87
本文介绍了\ n不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个程序,我在双引号打印语句中使用\ n,

应该给我一个换行符。它不起作用。我正在运行Apache 2.0

和PHP 5,Mozilla Firefox作为浏览器。有什么问题?

I am writing a program, and I am using \n in double-quoted print statements,
which should give me a line break. It doesn''t work. I''m running Apache 2.0
and PHP 5, with Mozilla Firefox as a browser. What is wrong?

推荐答案

Michael Bradley-Robbins写道:
Michael Bradley-Robbins wrote:
我正在写一个程序,我正在使用\\ \\ n在双引号的印刷语句中,
应该给我一个换行符。它不起作用。我正在运行Apache 2.0
和PHP 5,Mozilla Firefox作为浏览器。有什么问题?
I am writing a program, and I am using \n in double-quoted print statements,
which should give me a line break. It doesn''t work. I''m running Apache 2.0
and PHP 5, with Mozilla Firefox as a browser. What is wrong?




而且......你不会混淆\ n< - > < br /> ?


汉斯


-

提出问题的人是傻子五分钟;

谁不问问题仍然是个傻瓜



And... you''re not confusing \n <--> <br /> ?

Hans

--
"He who asks a question is a fool for five minutes;
he who does not ask a question remains a fool forever"


Michael Bradley-Robbins写道:
Michael Bradley-Robbins wrote:
I我正在写一个程序,我在双引号打印
语句中使用\ n,这应该给我一个换行符。它不起作用。我正在运行Apache 2.0和PHP 5,将Mozilla Firefox作为浏览器运行。什么
错了?
I am writing a program, and I am using \n in double-quoted print
statements, which should give me a line break. It doesn''t work. I''m
running Apache 2.0 and PHP 5, with Mozilla Firefox as a browser. What
is wrong?




查看源代码(浏览器中的view-source)或将输出包装在

< ;预>< /预>标签。

JW



Look at the source (view-source in your browser) or wrap the output in
<pre></pre> tags.
JW


Michael Bradley-Robbins写道:
Michael Bradley-Robbins wrote:
我是编写程序,我在双引号打印
语句中使用\ n,这应该给我一个换行符。它不起作用。我正在运行Apache 2.0和PHP 5,将Mozilla Firefox作为浏览器运行。什么
错了?
I am writing a program, and I am using \n in double-quoted print
statements, which should give me a line break. It doesn''t work. I''m
running Apache 2.0 and PHP 5, with Mozilla Firefox as a browser. What
is wrong?




这个需要进入FAQ列表。


\ n给出你在发送到浏览器的数据中有换行符,所以如果你在浏览器中选择查看源选项,你会看到来源

确实有一个你期待它的线路。但是,HTML中会忽略
换行符。要在浏览器中呈现HTML格式换行符,需要< br>标签。


-

克里斯希望 - 电动工具箱 - http://www.electrictoolbox.com/


这篇关于\ n不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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