Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   PHP / mySQL (http://siteownersforums.com/forumdisplay.php?f=10)
-   -   Difference between echo,print and die (http://siteownersforums.com/showthread.php?t=54508)

Spoint_Vinil 02-07-2012 11:56 PM

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

ruixuan 02-27-2012 12:55 AM

see Fibroids Treatment Uterine Fibroids

maxsamuel 04-03-2012 02:00 AM

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.

spaculus 05-26-2012 06:28 AM

Quote:

Originally Posted by maxsamuel (Post 210449)
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.

your points of difference are very best.

Die is used for hide anything in below part during execution.

manojob 05-27-2012 10:35 PM

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.

henryc10 10-20-2012 07:01 PM

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

eswari 10-22-2012 12:12 AM

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

newage123 10-22-2012 03:54 AM

thank you....

Josephsanaya 11-02-2012 02:58 AM

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.

RohanJaiswal 04-23-2013 12:00 AM

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.