Home Backend Development PHP Tutorial Example introduction to the difference between r rn t in php_PHP tutorial

Example introduction to the difference between r rn t in php_PHP tutorial

Jul 13, 2016 am 10:39 AM
r t

n Soft return:
means a line break in Windows and returns to the beginning of the next line. Equivalent to the effect of r in Mac OS.
In Linux and Unix, it only means line break, but it will not return to the beginning of the next line.

r Soft space:
in Linux and unix means returning to the beginning of the current line.
In Mac OS, it means wrapping and returning to the beginning of the next line, which is equivalent to the effect of n in Windows.

t Tab (move to next column).

They are valid in strings represented by double quotes or delimiters, but not in strings represented by single quotes.
rn is generally used together to represent the Enter key on the keyboard, or just n can be used.
t represents the "TAB" key on the keyboard.

Just like the difference between using enter and shift+enter, if you want to display the effect on the page, you need to convert it into HTML code or use...

Newline symbol in the file:

linux, unix: rn
windows: n
Mac OS: r

corresponds to:

n LF or 0x0A(10) in ASCII
r 0x0D(13) in CR or ASCII
t Horizontal tab - 0x09 (9) in HT or ASCII
\ backslash
$ dollar sign
" double quote
' Single quotation marks

about their origins and cause differences:

The origins and differences between the two concepts of "carriage return" and "line feed" .
Before the advent of computers, there was a thing called the Teletype Model 33, which could type 10 characters per second. But it had a problem, which was that it had to use a new line after typing. If you go to 0.2 seconds, you can type two characters. If a new character is transmitted during this 0.2 seconds, the character will be lost

So, the developers thought of a way to solve this problem. Just add two characters to indicate the end of each line. One is called "carriage return", which tells the typewriter to position the print head at the left border; the other is called "line feed", which tells the typewriter to move the paper down one line. 🎜>This is the origin of "line feed" and "carriage return", which can be seen from their English names

Later, the computer was invented, and these two concepts were introduced to computers. At that time, memory was very expensive, and some scientists thought it was too wasteful to add two characters at the end of each line. So, there was a disagreement. In Unix systems, only one character was added at the end of each line. "", which is "n"; in Windows system, the end of each line is "", which is "nr"; in Mac system, the end of each line is "< "Enter>". A direct consequence is that if a file under Unix/Mac system is opened in Windows, all text will become one line; while if a file in Windows is opened under Unix/Mac, at the end of each line There may be an extra ^M symbol.

When programming in C language (windows system)

r is return. Returning to the beginning of this line will overwrite the previous output of this line

For example:



Copy code

The code is as follows: int main() { cout < < "hahaha" << "r" << "xixi" ;
}


Finally only xixi is displayed and hahaha back covers

n Yes Enter + line feed. Move the cursor to the beginning of the line first and then change to the next line, which is the beginning of the next line. Pull



Copy the code
The code is as follows: int main() {
cout << "hahaha" << "n" << "xixi" ;
}


will display:

hahaha
xixi



http://www.bkjia.com/PHPjc/730058.html

www.bkjia.com

http: //www.bkjia.com/PHPjc/730058.htmlTechArticlen Soft return: In Windows, it means a line break and returns to the beginning of the next line. Equivalent to the effect of r in Mac OS. In Linux and Unix, it only means line break, but it will not return to the next line...
Statement of this Website
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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
Trezor Cold Wallet: Model One and Model T Features and Usage Guide Trezor Cold Wallet: Model One and Model T Features and Usage Guide Jan 19, 2024 pm 04:12 PM

After problems occurred in many centralized exchanges, more and more cryptocurrency investors began to transfer assets to cold wallets to reduce the risks posed by centralized exchanges. This article will introduce Trezor, the world's earliest cold wallet provider. Since the first cold wallet was launched in 2014, it has been sold in many countries around the world. Trezor's products include Model One launched in 2014 and the advanced version Model T launched in 2018. The following will continue to introduce the differences between these two products and other cold wallets. What is Trezor cold wallet? In 2014, Trezor launched the first cold wallet ModelOne. In addition to common BTC, ETH, USDT and other currencies, the wallet also supports more than 1,000 other currencies.

Python or R: Which programming language is better for data science? Python or R: Which programming language is better for data science? Apr 12, 2023 am 08:28 AM

A little background on R R is a programming language and analysis tool developed by Ross Ihaka and Robert Gentleman and first introduced in 1993. At the same time, it is also a free open source software with a rich statistical and graphical technology library. R is one of the most used tools by analysts, statisticians, and researchers for retrieving, cleaning, analyzing, visualizing, and presenting data. Many industries such as IT, banking, healthcare, and finance use R. Purpose Data scientists can use the R programming language to collect data, perform statistical analysis, and produce visualizations. It can be used for graphical representation. R can be used for both machine learning and deep

How does Redstone (RED) benefit BNBHolder this airdrop? How does Redstone (RED) benefit BNBHolder this airdrop? Mar 04, 2025 pm 06:06 PM

Redstone (RED) airdrop activity brings great benefits to BNB holders! Redstone, an innovative multi-chain oracle project that supports more than 70 blockchains and covers more than 1,250 assets, has its token RED airdropped through Binance Launchpool. By participating in the activities, BNB holders can invest idle assets into the RED reward pool for mining, obtain RED tokens, realize asset appreciation, improve asset utilization efficiency, enrich investment portfolios, and reduce risks. However, we need to pay attention to volatility in the cryptocurrency market, invest rationally, and assess risks carefully. Join Redstone (RED) airdrop now and seize wealth opportunities!

Win11 Build 23419 preview version introduces new features: Screen recording can now be completed through the Win + Shift + R shortcut key Win11 Build 23419 preview version introduces new features: Screen recording can now be completed through the Win + Shift + R shortcut key Dec 21, 2023 pm 05:08 PM

Microsoft today released the Win11Build23419 preview update for WindowsInsider project members in the Dev channel. In addition to many improvements such as the new USB4 settings page in this update, some new functions/features introduced by Microsoft have not been written into the update log. Microsoft is about to introduce a new function/feature to Win11. Users can use the Win+Shift+R shortcut combination to record the screen. However, this function is not yet effective. After using this keyboard shortcut, the regular screenshot UI will be opened instead of the screen recording UI. Netizens can enable the above new functions and features through the ViveTool tool: 1. Download the Vivetool tool from the GitHub page, and then

What is the difference between PHP functions and R functions? What is the difference between PHP functions and R functions? Apr 25, 2024 pm 03:51 PM

PHP and R functions have the following differences in syntax, data types, data structures and function scope: 1. Syntax: PHP functions follow C-style syntax, while R functions use S-style syntax. 2. Data type: PHP is a weakly typed language, while R is a strongly typed language. 3. Data structure: PHP supports a variety of data structures, while R is dedicated to statistical data and provides optimized data structures. 4. Function scope: PHP function scope is limited to the function body, while R function scope is more complex.

What is the role of r in linux What is the role of r in linux Mar 25, 2023 am 10:22 AM

The role of r in Linux is to read the actual content of this file; having r permission in Linux means that you can read the directory structure list, which means you can view the file names and subdirectory names under the directory; the main content of the directory is the record file A list of names and subdirectories, not where the data actually resides.

Detailed introduction to R71700 compatibility with Windows 11 Detailed introduction to R71700 compatibility with Windows 11 Jan 13, 2024 pm 05:24 PM

As we all know, the win11 upgrade has very high requirements for the processor, so some AMD Ryzen r71700 processor users don’t know whether their computers can install the win11 system. In fact, we don’t have to worry, it can be installed. Let’s follow the editor’s instructions Let's get up and take a look at the specific situation. Can r71700 be installed with win11? Answer: r71700 processor can be installed with win11 system. Installation method one: 1. First enter "Settings" through the start menu in the lower left corner 2. Then select "Update and Security" 3. Then enter the Windows Insider Program, and after joining, select "dev channel" 4. Then enter "Windows Update ”, where you can download and install win11 by detecting updates.

In simple terms, analyze the choice of T and t in Golang In simple terms, analyze the choice of T and t in Golang Apr 08, 2024 pm 02:03 PM

T and t are datetime types in Go with different uses: T type: Represents the number of seconds since the epoch, used for rough time estimation. t type: Contains date, time and time zone information, used for precise time recording and taking into account time zone differences.

See all articles