Print Vs Echo

[Solved] Print Vs Echo | Php - Code Explorer | yomemimo.com
Question : Difference between echo and print statement in php

Answered by : ankur-prajapati

Source link:
https://www.programmingquest.com/2019/04/difference-between-echo-and-print.html
1. echo Statement
* we can write echo statement with parenthesis like 'echo()' or without parenthesis 'echo'.
* In the echo we can pass multiple variable in comma separated form to see the output like 'echo $a,$b,$c;'
* echo doesn’t return any value
* echo is faster then print
2. Print Statement
* we can write print statement with parenthesis like 'print()' or without parenthesis 'print'.
* In the print we can not pass multiple variable in comma separated form like echo.
* print statement always returns 1.
* print is slower than echo

Source : https://www.programmingquest.com | Last Update : Mon, 20 Apr 20

Question : echo php

Answered by : clean-code-dev

<?php
$string = "Hello, World!";
echo $string;
?>

Source : | Last Update : Tue, 13 Oct 20

Question : print vs echo

Answered by : k-e-h-rahat

echo and print are more or less the same. They are both used to output data to the screen. The differences are small: 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 (although such usage is rare) while print can take one argument.

Source : | Last Update : Sat, 03 Sep 22

Answers related to print vs echo

Code Explorer Popular Question For Php