The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Whats the difference be tween these two?
My book says that there the same, And I see Vb uses Echo everywhere. so ummmmmmmm whats the difference Thanks! |
#2
|
||||
|
||||
one ASCII character
Actually, theres more to it... echo() can take multiple arguements (when enclosinge the parameters within parentheses). print() will return TRUE on success and FALSE on failure. They basically are the same. Just small, almost irrelevant differences. |
#3
|
|||
|
|||
ok so echo can do this
echo "somthing" "something" "something"; and print can only do this print "something"; ??????? hey also there is one more thing that I am confused about what ezactly dose the command /n do? Thanks a lot |
#4
|
|||
|
|||
Well form C++ i can tell you that \n is like when you hit enter or in html known as <br>
|
#5
|
||||
|
||||
Okay, lets me see if I can help with this.
plain HTML lets HTML print out the text. echo statement has php simply print out HTML code. print statement is a function, so it uses more recourses. This is for the most part how I have come to understand it. Many people have tested all three to see what is faster to use, and yes it's way to close to matter to most of us. When I was first working with php I was using echo since that was all I really ever seen. Then I bought a PHP book and they used a "pro" looking print tag PHP Code:
|
#6
|
||||
|
||||
when sending echo() multiple arguements, use this syntax:
echo "somthing", "something", "something"; ... you forgot the commas /n does nothing, \n is a new line character |
#7
|
|||
|
|||
whoops.. yeah that's what i meant.. lol
|
#8
|
|||
|
|||
err, I am a little confused!
All print can do, is display text right?? So echo can display text, but dosn'nt need to be retyped? so print "hello, world" print "this is a second test" vs Echo "hello world","this is a second test" >???????????? O and by the way, thank you guys so much for taking your time |
#9
|
||||
|
||||
So they are the same, it's all about what your preference is. Use what ever you think looks better. Both function the same, and any speed differences are not a concern for the average user.
If you want just make a empty php page and play around testing out what works with what. If you get a parse error then it wasn't right. I've seen both tags used many different ways, it's just all about what you prefer. |
#10
|
||||
|
||||
The fact that echo() can take several arguements is really a mute point.... take this for example:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|