Home >>PHP String Functions >PHP echo() Function

PHP echo() Function

PHP echo() Function

PHP echo() function is a statement i.e used to display the output.
This echo() function can be used with parentheses echo or without parentheses echo.
In echo() function we can pass multiple string separated as ( , ).
The echo() function doesn't return any value like the print() function but echo() is little faster then print().

Syntax :

echo (argument1, argument2, ... );

Let's see some example of echo() function:

echo $name;
echo ($name);

We can also pass multiple arguments in echo():

$name = "John";
$profile = "PHP Developer";
$age = 25;
echo $name ." ". $profile ." ". $age ." "." years old";
John PHP Developer 25 years old

We can also print the elements of an array using the echo():


print "We love " . $a['0'] . " & ".$a['1']." also.";

We love PHP & Python also.

Popular Tutorials