ALL >> Education >> View Article
The Hello World Program In Php
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.
Add Comment
Education Articles
1. Coding Camps 2026: Tcci South Bopal, Ahmedabad HubAuthor: TCCI - Tririd Computer Coaching Institute
2. Machine Learning Operations Training | Mlops Training In India
Author: Visualpath
3. Best Online It Courses: Learn With Tcci, Ahmedabad
Author: TCCI - Tririd Computer Coaching Institute
4. Sap Trm: A Complete Guide To Treasury And Risk Management In Sap
Author: Kamini
5. Kcsa Certification: The Smart Career Move For Modern Cybersecurity Professionals
Author: Passyourcert
6. Boost Your It Career: The Ultimate Guide To Earning Your Acmp Certification
Author: Passyourcert
7. Why Working Professionals Are Choosing Mba Dual Specialization Programs
Author: INDIAN INSTITUTE OF BUSINESS MANAGEMENT & STUDIES
8. Tcci: Online Data Analytics Courses
Author: TCCI - Tririd Computer Coaching Institute
9. Cambridge Curriculum Schools In Hyderabad
Author: vijji
10. Summer Python Course Near Iskcon Road - Tcci
Author: TCCI - Tririd Computer Coaching Institute
11. Best Salesforce Data Cloud Course | Corporate Training
Author: Vamsi Ulavapati
12. Microsoft Fabric Online Training Course With An Expert
Author: gollakalyan
13. The Increasing Demand For Data Science Skills Across Dombivli’s Emerging Talent Pool
Author: Dhwani
14. Sap Btp Cap Online Training | Sap Fiori Online Training
Author: Visualpath
15. Power Automate Online Training | Power Automate Classes
Author: naveen






