PHP echo and print Statements


 

There are two different methods to get output in PHP

 

Example

<!DOCTYPE html>

<head>

  <title>Document</title>

</head>

<body>

 

<?php

 

print"This is print statement.<br>";

echo"This is echo statement.<br>";

print("This is print statement. <br>");

echo("This is echo statement.<br>");

 

?>

</body>

</html>


Output

php echo and print statement