What is the difference between echo and print in PHP

In PHP, both `echo` and `print` are used to output data to the screen. However, there are some differences between them:
  • echo can take multiple arguments (though it is rarely used this way) and does not return a value.
  • print can only take one argument and always returns 1, which means it can be used in expressions.
  • echo is slightly faster than print because it does not return a value.
PHP, echo, print, output, differences
<?php // Using echo echo "Hello, World!"; // Using print print "Hello, World!"; ?>

PHP echo print output differences