php w3school.info

How to Make First PHP Program?

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.

Published by

Jeetendra Singh

Jeetendra Singh is a Full Stack Architect who has 12+ Years of Experience into Software Development. 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), Python, DJango, Redis, Mysql, Dynamo DB , Devops, Jenkins, Cloud/Lamda , Fast Api. He build variety of applications using Python, Mern, Mean, Node, JavaScript, jQuery & PHP