PHP Echo

echo - Output one or more strings

echo accepts an argument list and doesn't have a return value. it can be used with or without parentheses: echo or echo().

echo is marginally faster than print.

Below the syntax of PHP echo

void  echo ( string $arg1  [, string $... ] )

Print a variable value using short tag

<?php  
  $num = 5;
?> 
I have <?=$num?> cars // Output I have 5 cars

Print a String

<?php  
   echo "Hello World!"; // Outpul Hello World! 
?>

Print a variable value

<?php  
  $msg= "Hello World!"; 
  echo "message is : $msg"; // Output  message is : Hello World! 
?>

Print escaping characters

<?php  
 echo "Hello "World!"; // Output  Hello World!
?>