How to Remove the Legend Colour Box in Chart JS
What is the fixed GST rate for foods ?
What is the fixed GST rate for foods ?
How to send attachments with PHP Mail?
Enable & Disable a Div and its elements in Javascript
echo and print both are used to output data to the screen.
echo has no return value while print has a return value of 1 so it can be used in expressions. echo can take multiple parameters, while print can take one argument. echo is faster than print.
Echo Statement:
Example
<?php
echo "<h2>PHP is Fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?>
We can also output the variables with echo statement.
Example
<?php
$txt1 = "Learn PHP";
$txt2 = "W3Schools.com";
$x = 5;
$y = 4;
echo ($txt1);
echo "<h2>$txt1</h2>";
echo "Study PHP at $txt2<br>";
echo $x + $y;
?>
Print Statement
Example
<?php
print "<h2>PHP is Fun!</h2>";
print "Hello world!<br>";
print "I'm about to learn PHP!";
?>
We can also use variable with the print.
Example:
<?php
$txt1 = "Learn PHP";
$txt2 = "W3Schools.com";
$x = 5;
$y = 4;
print "<h2>$txt1</h2>";
print "Study PHP at $txt2<br>";
print $x + $y;
?>