search
Homephp教程php手册深入探讨"<br />"和 &q

深入探讨"<br />"和 &q

Jun 13, 2016 am 11:51 AM
amphtmlquotWhatcodethe differenceandclientnewlineDiscussEffectyeshavego deepofoutput

\r\n是输出的HTML代码换行,客户看到的效果没有换行。

则相反
效果:
我是内容\r\n我是内容
我是内容
我是内容
==================================================
\r 表示:回车符(ACSII:13 或0x0d),就是我们常说的硬回车。
\n 表示:换行(ACSII:10 或0x0a),就是我们常说的软回车。

在页面里这两个是看不到效果的.右键查看源文件可以看到代码换行
==================================================
如果是输出给浏览器,就用

如果是输出到自己的文件里,就用"\n",windows下是"\r\n"
==================================================
\n,好比你在DreamWeaver里做一个网页,在源代码里按一下回车,是给源代码换行。
是输出一个(HTML标记性语言),在HTML中解释为输入的字换行。 \n的作用是给源代码换行,输入后,查看HTML源代码,就看会到有换行,而HTML解释器(浏览器)认为它是没用的东西,用不用都一样显示。
==================================================
\n 是源代码换行!

是网页表现换行!!
==================================================
附:深入PHP nl2br()格式化输出的详解

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software