Welcome to the PHP-scripts blog. Though I’m not a huge fan of ‘Hello World’ stuff, it seems that is where most things in the programming world start out. So here we go with examples using print and echo
Hello World using print statement
Hello World using echo
What is the difference between print and echo? print behaves like a function and can be used in expressions like this, where echo cannot:
echo is a tiny bit faster since it doesn’t set a return value.
Programming tips
Pick one format and stick to it. For example, I like to use echo for echoing variable values like this:
But I prefer print for mixing text and variables like this:
Since you can use or not use parenthesis, it’s important to determine a style that is consistent throughout coding projects to keep code easy to read.

[…] This morning I was looking at the ads YPN was showing on my newly launched PHP blog and was wondering how “free calls” and Vonage had anything to do with this post which is filled with programming references and code. The whole page and blog is about PHP programming so what does that have to do with Vonage? Why was the Yahoo Publishing Network (YPN) showing Vonage and Cheap Calls: USA to Guyana. Or the Florist.com ad for that matter. Maybe it’s send flowers to your favorite programmer day. […]
on September 7th, 2005 at 12:54 pm | #Link Comment< b >< a href=”http://kimkhan.com/mywiki/DonnaIkyc” >women haircuts< /a >< /b >< /blockquote >
Simply desire to say your article is as amazing. The clearness in your post is simply great and i can assume you are an expert on this subject. Well with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks a milli…
on February 2nd, 2012 at 6:06 am | #Link Comment