123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Education >> View Article

The Hello World Program In Php

Profile Picture
By Author: bootsity
Total Articles: 1
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

1. Overview
We start learning any programming language, with the famous hello world! program. This tradition is followed religiously since the inception of software programming, and we are happy that we will support it too. We will learn the basics of PHP in this series, named “PHP – Back to basics.” Let’s start with the first article in the series.

2. What is PHP
Wikipedia defines PHP as – “Hypertext Preprocessor (or simply PHP) is a server-side scripting language designed for Web development, but also used as a general-purpose programming language.” In simple words, PHP is a general purpose programming language which powers most of the web. Notable websites like Wikipedia and Facebook are built on PHP.

3. hello world! program
3.1 Writing the program
To write the program, you can use Eclipse IDE. If you do not have eclipse already, you can follow our installation guide. Below is the hello world program written in PHP:


3.2 Running the program
The above program is saved in a file named index.php

Assuming that we have our environment setup up and running, ...
... if not you can follow this guide to setup your environment.



We can put our index.php in the server root (root folder of the server) and open http://localhost/ in a browser.

In browser, we see following output:

hello world!
3.3 Understanding the program
PHP is an interpreted language. The PHP interpreter, an executable program reads PHP from files and runs it line by line. Our hello world program has only three lines. Let’s try to understand them:

The first line – is treated as php program by the interpreter and is executed line by line.



The second line – echo "hello world!"; starts with a keyword echo which instructs compiler to print whatever follows to the output. Then there is a string "hello world!" , which combines up and says to compiler to print “hello world!”. In the last there is a terminator ; , which tells the interpreter that this the end of current command and you can move forward.

The third and the last line – in our program, ?> tells the interpreter that this is the end of PHP script block.

4. Conclusion
In this article, we write our first PHP program – hello world!, run it and understood it deeply. In the upcoming articles, we would explore more and will learn about variables, strings, operators and lot more things. Also, all of our code is available on GitHub.

Total Views: 72Word Count: 420See All articles From Author

Add Comment

Education Articles

1. A Comprehensive Guide To Choosing The Right Sap Course For Your Career Goals
Author: lakshmana swamy

2. Ai Agent Course In Ameerpet | Training By Visualpath
Author: gollakalyan

3. Sap Ariba Online Training & Sap Ariba Course India
Author: krishna

4. Servicenow Cmdb Training | Servicenow Itom Course Online
Author: Hari

5. Redhat Openshift Training | Openshift Training In Hyderabad
Author: Visualpath

6. Industry-focused Data Science Course In Pune With Hands-on Learning
Author: Fusionsoftwareinstitute

7. Ai Llm Course | Llm Artificial Intelligence Course
Author: naveen

8. Fix The Green Gap: Isep Skills For Practical Managers
Author: Gulf Academy of Safety

9. Boost Learning With Easy & Effective Online Assessments
Author: Magicbox

10. School In Bangalore 2026-27 A Complete Guide To The Fees Ratings And Admissions
Author: shivam

11. Best Vapt Internship Program In India For Cybersecurity Students
Author: securium Academy

12. How Non-technical Professionals In Dehradun Are Entering The Data Science Industry
Author: dhanya

13. Explore Mbbs In Vietnam: Quality Education With Clinical Excellence
Author: Ashwini

14. Mbbs In Vietnam: Affordable Medical Education For Indian Students With Global Recognition
Author: Ashwini

15. Mbbs In Vietnam: World-class Medical Education At Reasonable Cost!
Author: ashwini

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: