Home Php echo- Not a function

 
 

Share on Google+Share on Google+

echo- Not a function

Advertisement
php generally we use echo command to print something.

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

This is a multiple line output

with $var1 interpretation

no whitespace should be placed with the terminator.

END;

echo "<br/>";

echo $var1.$var2;

?>

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

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 17, 2009

Related Tutorials

Discuss: echo- Not a function  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com