Page 1 of 1
print and echo(beginner)
Posted: Wed Jul 01, 2009 10:55 am
by lipun4u
what is the difference between print and echo ????

Re: print and echo(beginner)
Posted: Wed Jul 01, 2009 10:58 am
by Architek
I am a newbie as well but I think Print and Echo are the same functions just different syntax between old and newer php releases. I would imagine one is more appropriate to use... I have been using ECHO in most of my code. I am sure a php wiz will chime in and give us the scoop.
Re: print and echo(beginner)
Posted: Wed Jul 01, 2009 11:08 am
by BornForCode
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. For example $value = print "Hello World"; And $value will be 1.
4. Echo does not returns any values.
5. Echo is not suitable for conditional construct
6. Print is suitable for conditional construct. Example: $b ? print "true" : print "false";
7. Print process is slower than echo .
8. Echo can take multiple expressions. You can write echo "first term","second term";
I hope this helps you

Re: print and echo(beginner)
Posted: Wed Jul 01, 2009 11:12 am
by Architek
BornForCode wrote: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. For example $value = print "Hello World"; And $value will be 1.
4. Echo does not returns any values.
5. Echo is not suitable for conditional construct
6. Print is suitable for conditional construct. Example: $b ? print "true" : print "false";
7. Print process is slower than echo .
8. Echo can take multiple expressions. You can write echo "first term","second term";
I hope this helps you


Re: print and echo(beginner)
Posted: Wed Jul 01, 2009 11:30 am
by lipun4u
thanx.....
