What is the Diff. Between echo() and Print() in PHP?

Answer Posted / surendra.kandimalla

Echo:echo as a function we can pass only one argument.But echo as command we can pass any number of arguments.echo will not return anything.
echo("echo as function<br>");
echo"arg1","arg2","arg3","<br>";

Print:we can pass only one argument for print as function or command.print returns boolean value.
print("print function<br>");
$b=print"print command<br>";
echo $b,"<br>";

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use polymorphism in php?

545


What does the expression exception::__tostring means?

560


Does https prevent csrf?

520


Explain briefly about a search-friendly site looks like?

494


Is null in php?

530






Is laravel frontend or backend?

528


What is strlen php?

545


Explain about PHP cookies?

621


So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

554


Write a query to find the 2nd highest salary of an employee from the employee table?

645


What are php keywords?

533


What is variable and data type?

514


What is c++ polymorphism?

529


Can I run php without xampp?

502


What is a php namespace?

519