Save 100s of Dev Hours - Get The React Codebase Generator

How to Make First PHP Program?

php w3school.info

Hi Friends,

Before writing first PHP Program, you will have to set the environment. And, for make this, you need to install the Xampp server in your system.

After successful installation, we need a code editor, there are several code editors like Notepad++, Code Lobster, Netbeans etc. You can use any code editor as per your comfort for writing code.

First off, go to the drive where you have installed the Xampp server. Click on Xampp and go to the htdocs folder. But don’t forget to start Xampp control panel and Apache, MySql services before writing the code. Now create a folder for your project with any name. Suppose we create a folder name myproject.

Now inside this folder create a file name index.php. Below is the snippet for creating your first PHP program:

Program for Print Hello W3school

echo is a php function used for print/display on web browsers.

Now Run in localhost by following address

http://localhost/myproject/index.php

This will print the output as follows

 

Now we have done with “how to make first PHP program,” we will learn about the if – else statements, switch cases, array, data retrieval from database and many more, which are important to create a complete website.

You May Also Like

About the Author: Jeetendra Singh

Jeetendra Singh is a UI Architect who has 10+ Years of Experience as Full Stack Developer. He is a Microsoft certified technology Specialist and AWS Certified Associate Architect. His Major Interests are in Mongo Db, Express Js, React Js, Node Js (MERN STACK). He build variety of applications using Mern, Mean, Node, JavaScript & jQuery