search

Home  >  Q&A  >  body text

Can line breaks be achieved?

<?php

$greet = function($name)

{

echo $name.', Hello';

};

$greet('tomorrow');

$greet('PHP Chinese website');

?>

Tried I added \n and br at the end but it doesn't work. Is there any way to achieve line breaks?

vecvec2314 days ago1775

reply all(6)I'll reply

  • 小草

    小草2018-09-07 10:06:55

    "<br>"This way

    reply
    0
  • AWing

    AWing2018-08-26 11:01:30

    echo $name.', Hello<br />';

    reply
    0
  • 嘿哈

    嘿哈2018-08-21 17:31:57

    The line break in php is written like this "<br>"


    reply
    0
  • vec

    No, that's html, right?

    vec · 2018-08-22 14:37:46
  • 好名字

    好名字2018-08-20 19:54:00

    echo $name.',Hello'.PHP_EOL;

    reply
    0
  • vec

    Thank you! !

    vec · 2018-08-21 09:42:26
  • Cancelreply