What Is The Difference Between Print() And Echo() In Php?


6 Answers

Aiyyappan N Profile
Aiyyappan N answered
1. Echo works faster than print().
2. Echo and print are language construct.
3. Print behaves as a function and it returns an integer value.
4. Echo does not returns any values.
5. Echo is not suitable for conditional construct
6. Print is suitable for conditional construct.
7. Print process is slower than echo .
sundar vel Profile
sundar vel answered
Hi I`m sundar MCA,
      The difference between print() & echo()?
1. Echo() can take multiple expression
eg: Echo 'sundar','MCA'; // sundarMCA

2. Print() cannot take multiple expression
eg print 'sundar','MCA'; // Parse Error

3. Echo() doesn`t return any values.

4.print() return values.
Anonymous Profile
Anonymous answered
Echo is a statement print is a function.echo print the multiple function but print function print only one statement
Geetanjali Tyagi Profile
Print is function where as echo is not .Print return value but echo is not
Madbiker McMad Profile
Madbiker McMad answered
There's no difference. PHP has several examples of two functions that perform the same operation, really for backwards-compatibility or conveniences sake. Take your pick!
Anonymous Profile
Anonymous answered
The only difference between print and echo is that both of them displays results in different format.

Answer Question