Aryan PrajapatKnowledge Contributor
What is the difference between the PHP "echo" and "print"?
What is the difference between the PHP "echo" and "print"?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
One or more strings are output by PHP echo. It’s a feature of the language, not a function. As a result, there is no need to utilize parenthesis. If you wish to send more than one parameter to echo, you’ll need to use parentheses. PHP, on the other hand, prints a string. It’s a feature of the language, not a function. As a result, the argument list does not require the use of parentheses. In contrast to echo, it always returns 1.
Print can only output one string and always returns 1, but echo can emit one or more strings.
Because echo does not return a value, it is faster than print.