How to write line break in php

(*-*)浩
Release: 2023-02-23 18:14:02
Original
6162 people have browsed it

How to write line break in php

You can use PHP_EOL instead in PHP to improve the source code level portability of the code

Unix series (recommended learning:PHP programming from entry to proficiency)

\n
Copy after login

For Windows series

\r\n
Copy after login

For mac

\r
Copy after login

For example:

<?php
    echo PHP_EOL;
    //windows平台相当于    echo "\r\n";
    //unix\linux平台相当于    echo "\n";
    //mac平台相当于    echo "\r";
?>
Copy after login
Recommended related articles:
1.How to use line breaks in PHP? (Code sample)
Related video recommendations:
1.Dugu Jiujian (4)_PHP video tutorial

The above is the detailed content of How to write line break in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template