echo- Not a function
In php generally we use echo command to print something. echo is not a function rather a language construct. Unlike a function we do not need to pass the parameter within parenthesis, in addition if we want to pass more than one parameter then it is needless to pass the parameters within double quote.
Example:
<?php
echo"
This
is
multiple
line";
?>
Output:
This is multiple line
Example:
<?php
echo "Hello world"."<br/>";
echo"
This
is
multiple
line"."<br/>";
echo "To ignore any special character use \ & \" " ;
$var1="any value"."<br/>";
$var2="another value";
echo "value of \$var1 is=$var1";
echo"We can use (,) operator or (.) operator to pass the parameters";
echo "<br/>Example of comma operator: ".$var1,$var2;
echo "<br/>Example with period operator: ".$var1.$var2;
ECHO "<br/>ECHO IS NOT CASE SENSITIVE<BR/>";
echo <<<END 0
This is a multiple line output
with $var1 interpretation
no whitespace should be placed with the terminator. 1
END;
echo "<br/>";
echo $var1.$var2; 2
?>
Output:
Hello world
This is multiple line
To ignore any special character use \ & " value of $var1 is=any value
We can use (,) operator or (.) operator to pass the parameters
Example of comma operator: any value
another value
Example with period operator: any value
another value
ECHO IS NOT CASE SENSITIVE
This is a multiple line output with any value
interpretation no whitespace should be placed with the terminator.
any value
another value
3