echo

void echo(mixed data, [mixed...]) 

Sends string data to stdout.

Returns:

Nothing

Description:

echo is a language construct (as opposed to a function) that takes one or more arguments, converts them to a string, and sends them to stdout. Multiple arguments are separated with commas.

Note:

echo is slightly faster than print.

Caution:

Multiple arguments cannot be placed in brackets as with normal function calls. If this is done, a parse error occurs.

Version:

PHP 3+

See also:

To send a string to stdout:

The heredoc syntax—see the PHP Manual (http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) for more information

print() 
printf() 

Example:

Basic use of echo
 <pre> <?php // Use echo with a single argument ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.