Home > Net >  Why doesn't <br> work in php? Below code doesn't break the sentences
Why doesn't <br> work in php? Below code doesn't break the sentences

Time:09-21

<?php echo "This is my first php file";
echo "<br>";
echo "This is my first php file ";

echo "First name"   .   "second name";
echo "<br>";

echo 6;
?>

CodePudding user response:

You need to add \n or \r\n to see new lines in PHP output. <br> is for HTML newlines

CodePudding user response:

<?php echo "This is my first php file";
  ?>

  <br> <!-- only HTML -->

<?php
  echo "This is my first php file ";

  echo "First name"   .   "second name";
   ?>
 
 <br> <!-- only HTML -->

 <?php

  echo 6;
 ?>
  •  Tags:  
  • php
  • Related