PHP Echo and Print Statements

PHP Echo and Print Statements

PHP echo and print both statements are used to display the output in a web browser. The differences between both is print has a return value while echo has no return value. And one another differnce between both is echo can take multiple parameters while print can take one argument. echo is slightly faster than print.

PHP echo Statement

This is a simple h3 heading.";
// Declare Variable
$txt = "Welcome to Webcodeschool.com";
// Display variable
echo $txt;
?>

PHP Print Statement

This is a simple h3 heading.";
// Declare Variable
$txt = "Welcome to Webcodeschool.com";
// Display variable
print $txt;
?>