Php Script to Display Hello World


In the below Php Script we used echo keyword 
for Displaying a Statement.
We can use Echo Statements For Printing Purpose.

1)Simple Echo Statement.

<?php
echo "Hello World";
?>


2)Simple Echo Statement Using Variable

<?php  
$msg="Hello JavaTpoint PHP";  
echo "Message is: $msg";    
?>  


  • PHP echo statement can be used to print the string, multi-line strings, escaping characters, variable, array, etc. Some important points that you must know about the echo statement are:


  • echo is a statement, which is used to display the output.
  • echo can be used with or without parentheses: echo(), and echo.
  • echo does not return any value.
  • We can pass multiple strings separated by a comma (,) in echo.
  • echo is faster than the print statement.


Comments