print and echo(beginner)
Moderator: General Moderators
print and echo(beginner)
what is the difference between print and echo ???? 
Re: print and echo(beginner)
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.
-
BornForCode
- Forum Contributor
- Posts: 147
- Joined: Mon Feb 11, 2008 1:56 am
Re: print and echo(beginner)
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
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)
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)
thanx..... 