Difference between echo and print

echo and print both are used to output strings.


(i) It accepts multiple arguments.

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.


(i) It has only one argument.

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.