Question:
What is the difference between echo and print statement?
Answer:
Difference1:
echo() can take multiple expressions,Print cannot take multiple expressions.
echo has the slight performance advantage because it doesn't have a return value.
True, echo is a little bit faster. Source: CoolInterview.com
echo() can take multiple expressions,Print cannot take multiple expressions.
Print return true or false based on success or failure whereas echo just does what its told without letting you know whether or not it worked properly. Source: CoolInterview.com
Answered by: modi | Date: 1/30/2009
| Contact modi
echo is unformatted whereas print is formatted Source: CoolInterview.com
Answered by: vijay | Date: 5/30/2009
| Contact vijay
The print() function is slightly slower than echo(). echo() can take multiple expressions but Print() cannot take multiple expressions. Source: CoolInterview.com
Answered by: Raju | Date: 12/22/2009
| Contact Raju
Both are constructors to redirect the O/P.Echo is the faster way to redirect the output to the screen and it will take multiple parameters where in print we can't pass multiple parameters and it returns true on success false on failure. Regards, Jyotsna.Inampudi Source: CoolInterview.com
Answered by: jyotsna | Date: 6/16/2010
| Contact jyotsna
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|