PHP主题特殊字符 [英] PHP subject special character

查看:118
本文介绍了PHP主题特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在php中遇到了\ n特殊字符的问题。

i我正在使用:

echonewline demo \ n,它显示新行上的下一个内容 ;



但是在输出中它并没有给出新线。那么我怎样才能在PHP脚本中给出新的一行。

I have a problem with \n special character in php.
i am using :
echo "newline demo \n which display next content on new line";

but in output it doesn''t give new line. so how can i give new line in php script.

推荐答案

什么是新行取决于操作系统,有时还取决于你使用它的地方。例如,在Windows中,新行是CR LF(\\\\ n),但在MessageBox中,这些字符中的任何一个都充当新行。在编辑控件中,它不起作用。



请参阅: http://en.wikipedia.org/wiki/New-line [ ^ ]。



通常,PHP在Web应用程序中用作服务器端脚本,更常见的是,它会生成HTML HTTP输出。但是在HTML''\ n''中不是一个新行,它是一个空白字符。新行< br /> 。好吧,万一你不知道...



-SA
What is "new line" depends on OS and, sometimes, where you use it. For example, in Windows, new line is CR LF (\r\n), but in MessageBox, either of these characters along acts as a new line. In edit controls, it would not work.

Please see: http://en.wikipedia.org/wiki/New-line[^].

Most usually, PHP is used as a server-side script in Web applications, and, even more typically, it generates HTML HTTP output. But in HTML ''\n'' is not a new line, it is а… blank character. New line is <br/>. Well, in case you did not know…

—SA


这篇关于PHP主题特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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