php

Print or echo new line using PHP

We can use PHP_EOL to print or echo a new line in PHP. We can also use \n or \r\n to echo the new line in PHP.

<?php
    echo 'Data 1 is here' . PHP_EOL;
    echo 'Data 2 is here' . PHP_EOL;
?>

Output

Data 1 is here
Data 2 is here
Was this helpful?