print( ) is a function, echo is a language construct.
This means that print( ) returns a value, while echo doesn't.
You can include print( ) but not echo in larger expressions.
echo is run very fast than print.
<?php
print "<h2>PHP tips</h2>";
print "how to learn PHP";
?>
<?php
echo "test";
echo $_REQUEST['zipcode']) ;
?>
Writing to standard output via a file handle instead of simply with print( ) or echo is useful if you need
to abstract where your output goes, or if you need to print to standard output at the
same time as writing to a file.
This means that print( ) returns a value, while echo doesn't.
You can include print( ) but not echo in larger expressions.
echo is run very fast than print.
<?php
print "<h2>PHP tips</h2>";
print "how to learn PHP";
?>
<?php
echo "test";
echo $_REQUEST['zipcode']) ;
?>
Writing to standard output via a file handle instead of simply with print( ) or echo is useful if you need
to abstract where your output goes, or if you need to print to standard output at the
same time as writing to a file.