PHP program to print simple message using echo and print.

Question: Write a PHP program to print simple message using echo and print.

Similarities between print and echo:
1. Both print and echo are used to display message on screen.
2. Both are language constructs and not functions.
3. Both can work with and without the parentheses.

Differences between print and echo:
1. echo does not return anything whereas print always returns 1.
2. echo can take multiple arguments whereas print can work with only 1 argument.

<?php

//All the following statements will print message 'Hello World'
print("Hello World");
print "<br />";
print "Hello World";
print "<br />";
print "Hello"." "."World";
print "<br />";

print 'Hello World';
print '<br />';
print 'Hello'.' '.'World';
print '<br />';

echo("Hello World");
echo "<br />";
echo "Hello World";
echo "<br />";
echo "Hello"." "."World";
echo "<br />";

echo 'Hello World';
echo '<br />';
echo 'Hello'.' '.'World';
echo '<br />';
echo "Hello", " ", "World";
echo "<br />";
echo 'Hello', ' ', 'World';
echo '<br />';

?>