echo() function in PHP || PHP Echo Function
×


PHP echo() function

10492

PHP echo() function is used to get the output of regular expression or print strings in PHP. It is an inbuilt function in PHP. The working of this function is the same as print() function but it is faster than print().

Note:

This function can be used without parenthesis in the case to outputs more than one strings.

Syntax:

echo($str);
or
echo $str1.$str2.$strN;

here,

$str, $str1, $str2 and $strN are PHP strings.


Example 1:

<?php
$str="Welcome to Coding Tag.";
echo($str);
?>

Example 2:

In the case of multiple strings we use this function without parenthesis.

?php
$str1="Delhi is the capital of India.";
$str2="It has so many tourist places";
echo $str1.$str2;
?>

Output:

Result - PHP echo() function



Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments