Pages

PHP echo-Function

In PHP, echo is used to output one or more strings. Even though echo behaves like a string function, it is technically not a function, as it doesn't require a parenthesis.
The syntax of the echo construct is:
echo [string]
where [string] means one or more strings.
Let's take a look at the examples below:
Example 1
echo 'You are reading a tutorial on PHP echo construct.';
Result:
You are reading a tutorial on PHP echo construct.
Example 2
$var = 'Learn PHP';
echo $var;
Result:
Learn PHP
Example 3
echo 'This shows ' . 'how echo can ', 'be used to concatenate a string.';
Result:
This shows how echo can be used to concatenate a string.

If you like this please Link Back to this article...



0 comments:

Post a Comment