Same.
Echo and print statement :-
Echo and print statement is almost same in php. There is a little bit difference between print and echo statement. Difference between echo and print statement is that echo has no return valueAnd echo statement has the return value of 1 so it can be used in expressions. Echo takes multiple parameters while on the other hand print statement takes
One argument. echo is much faster and easier to use.
PHP echo Statement:-
The echo statement can be used with or without parentheses: echo or echo().
Output with echo statement:-
The following example shows how to output text with the echo command (notice that the text can contain HTML markup).
Output variables with Print statement:-
The following example shows how to output text and variables with the print statement.
<?php
$text1 = "Learn PHP";
$text2 = "s1school.blogspot.com";
$i = 5;
$s = 4;
print "<h2>$text1</h2>";
print "Study PHP at $text2<br>";
print $x + $y;
?>
$text1 = "Learn PHP";
$text2 = "s1school.blogspot.com";
$i = 5;
$s = 4;
print "<h2>$text1</h2>";
print "Study PHP at $text2<br>";
print $x + $y;
?>
0 comments:
Post a Comment
Thanks