![]() |
Difference between echo,print and die
what are the Differences between echo,print and die ?I havent find any differences.Let me know if such differences exist
|
|
Well I have found 3 major differences between echo and print:
Echo: 1) Does not return value. 2) Faster than 'print'. 3) Can take multiple arguments. Print: 1) It returns value. 2) Slower than 'echo'. 3) Cannot take multiple arguments. |
Quote:
Die is used for hide anything in below part during execution. |
The differences between Echo and print are:
1. Print has a return value of 1. 2. Print is slow compare to echo. 3. Echo does not return value. 4. Echo is faster compared to print. |
Difference between echo and print
1. Speed (echo is slightly faster than print) 2. Parameter (echo can take multiple parameters unlike print) 3. Expression (print can be used as part of more complex expression where echo cannot) die is another thing which has the same functionality of exit |
Echo and Print are used for the same functionality printing of data.But there is echo is not a function we cannot pass arguments ,where as print is a function we can pass arguments
die() function prints a message and exits the current script. ex: $c=mysql_connect('host','username','pass') or die(); if the mysql connection is unsuccessful then this will die |
thank you....
|
Main difference between echo() and print() is that echo is just an statement not a function and doesn't return's value or it just prints a value whereas print() is an function which prints a value and also it returns value.
|
echo is used to display the output but it does not return value.
but in print, it return some value. and die prints the message and exits the current script. |
All times are GMT -7. The time now is 05:16 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.