PHPGurukul

Echo vs. Print in PHP

Echo (PHP)Print (PHP)Parametersecho can take more than one parameter when used without parentheses. The syntax is echo expression [ expression[ expression] … ]. Note that echo ($arg1 $arg2) is invalid.Print only takes one parameter.Return valueEcho does not return any valuePrint always returns 1 (integer)Syntaxvoid echo ( string $arg1 [ string $… ] )Int print ( string $arg )What is it?In PHP echo is not a function but a language construct.In PHP print is not a really function but a language construct. However it behaves like a function in that it returns a value.]]>

Anuj Kumar

This is Anuj Kumar. I’m a professional web developer with 4+ year experience. I write blogs in my free time. I love to learn new technologies and share with others.
I founded PHPGurukul in September 2015. The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops and other web development tutorials.
.

Recommended Tutorials for you


Add comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.