What is Echo? What is the difference between Echo and Print statement in PHP?
Can anyone tell me the difference between the Echo and Print statement in PHP, when these functions should be used in programming.
Re: What is Echo? What is the difference between Echo and Print statement in PHP?
Both are output statements, Both are language constructs, print returns a value. require parenthesis. echo accept multiply argument, echo give u same output, echo doesn't return anything and it is like a tag print always return a integer value 1.
Re: What is Echo? What is the difference between Echo and Print statement in PHP?
echo accept multiply argument, echo give u same output, echo doesn't return anything and it is like a tag print always return a integer value 1. 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. echo is basically what is going to be said, the bracket is the t-string, then the opening speech marks are what is going to be said in the echo.
Re: What is Echo? What is the difference between Echo and Print statement in PHP?
Print() acts like a function in that it returns a value and can be used in complex expressions. echo and print are both language constructs and do not (and should not) require parenthesis. echo accept multiply argument, echo give u same output, echo doesn't return anything and it is like a tag print always return a integer value 1. echo() can take multiple expressions,Print cannot take multiple expressions. echo has the slight performance advantage because it doesn't have a return value.