Example
Use echo to output some text:
html
<?php
echo "Hello World!";
?>
Definition and Usage
The echo keyword is used to output one or more strings.
The echo keyword has no return value.
echo and print are more or less the same. They are both used to output data to the screen.
The differences are small:
echohas no return value, whileprinthas a return value of 1 so it can be used in expressionsechocan take multiple parameters, whileprintcan take one argumentechois marginally faster thanprint
More Examples
Example
Use echo to output multiple strings:
html
<?php
echo "Hello ", "World", "!";
?>
Related Pages
The print keyword