1<?php
2 echo "Hello World!";
3// You can also do this with a variable:
4$YourVariable = "Hello World!";
5echo $YourVariable;
6?>
1Source link:
2https://www.programmingquest.com/2019/04/difference-between-echo-and-print.html
3
41. echo Statement
5* we can write echo statement with parenthesis like 'echo()' or without parenthesis 'echo'.
6* In the echo we can pass multiple variable in comma separated form to see the output like 'echo $a,$b,$c;'
7* echo doesn’t return any value
8* echo is faster then print
9
102. Print Statement
11* we can write print statement with parenthesis like 'print()' or without parenthesis 'print'.
12* In the print we can not pass multiple variable in comma separated form like echo.
13* print statement always returns 1.
14* print is slower than echo