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: Admin

We are the Web Developer, technical writer and a blogger from jaipur and worked with PHP,Mysql,JavaScript,Node Js,Angular Js,Jquery,JQuery Mobile,.Net,Sql Server etc., but his language of choice is PHP & JAVASCRIPT. You can learn more and discussion with us at w3school