Difference between echo and print

echo and print both are used to output strings.

echo

(i) It accepts multiple arguments.


<?php 
$company_name='TCS';
echo 'company name is',$company_name; 
?>
Output:- company name is TCS

Note:- Comma is used for concatenation between the strings and we can pass multiple arguments through comma sign.

(ii) It has no return value.

(iii) echo is faster than print.

print

(i) It has only one argument.


<?php 
$company_name='TCS';
print 'company name is',$company_name;
?>
Output:- Parse error: syntax error

Note:- In this example, we passed two-argument so It shows a Parse error.

(ii) It has a return value.

(iii) the print is slower than an echo.