I am learning PHP at the moment and I have a question about printing outputs using PHP. I know the both “echo” and “print” displays an output.
For example:
gives the same output.
My question is what is the difference between the two? When do you use echo and print?
My other question is how do I add a space between different text outputs? For example, the above code when put next to each other outputs “Hello WorldHello World”. How can I add a space between World and Hello?
Thanks you very much!
MasterA
For example:
echo “Hello World”;
print “Hello World”;
gives the same output.
My question is what is the difference between the two? When do you use echo and print?
My other question is how do I add a space between different text outputs? For example, the above code when put next to each other outputs “Hello WorldHello World”. How can I add a space between World and Hello?
Thanks you very much!
MasterA

