PHP echo and print Statements

AuthorHariom Prajapati

Pubish Date24 Jul 2022


  • Echo and print both are almost same, which is used to get output.
  • The echo statement can be used with parentheses: echo() or without parentheses: echo.
  • The print statement can be used with parentheses: print() or without parentheses: print.


There are two different methods to get output in PHP

  • echo or echo( )
  • print or print( )



<!DOCTYPE html>


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





php echo and print statement