PHP中的\ r和\ n是什么意思? [英] What are \r and \n meaning in PHP?

查看:162
本文介绍了PHP中的\ r和\ n是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些被称为\ r \ n,并且有一个解释它们的教程吗?

what are these called \r \n and is there a tutorial that explains them?

推荐答案

它们分别是回车"和换行".通常,在Windows上,您需要同时使用两者来表示行终止符:"\ r \ n",而在大多数(全部?)Unix系统上,"\ n"就足够了.

They're "carriage return" and "line feed" respectively. Typically on Windows, you need both together to represent a line terminator: "\r\n" whereas on most (all?) Unix systems, "\n" is enough.

请参阅 Wikipedia换行条目,以了解有关不同系统的变化情况的更多详细信息.

See the Wikipedia Newline entry for more details about the vagaries of different systems.

有关一般转义序列的更多详细信息,请参见 PHP手册. ,其他在PHP中可用.

See the PHP manual for more details about escape sequences in general, and the other ones available in PHP.

许多其他语言(例如C,C ++,C#,Java,Perl,Python,Ruby)共享用于回车和换行的相同转义序列-但它们都是针对个别语言指定的. (换句话说,它是特定于语言的,但是对于许多语言来说答案是相同的.)

Many other languages (e.g. C, C++, C#, Java, Perl, Python, Ruby) share the same escape sequences for carriage return and line feed - but they are all specified for the individual language. (In other words, it is language specific, but the answer would be the same for many languages.)

这篇关于PHP中的\ r和\ n是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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