Home  >  Article  >  Backend Development  >  How to write line break in php

How to write line break in php

(*-*)浩
(*-*)浩Original
2019-09-06 14:16:566161browse

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

For Windows series

\r\n

For mac

\r

For example:

<?php
    echo PHP_EOL;
    //windows平台相当于    echo "\r\n";
    //unix\linux平台相当于    echo "\n";
    //mac平台相当于    echo "\r";
?>
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!

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