pTutorial

New way to learn PHP

PHP First script

How to run PHP script

Type your first PHP script in a text editor like Notepad or notepad++, Shown in the image below.

First step of run PHP script

After writing the script save this file in a given location with .php extension.

C->WAMP->www->project (Project folder is created by user. )

Generally WAMP folder is there but you can changed that location on the time of installation then save this file in that location.

The extension of this script is .php

ptutorial |run PHP script

After saving the file colour of PHP syntax and text are different like that.

Now open your web browser like Google Chrome, Internet Explorer.

Type (localhost) in the address bar.

php tuitorial

Your project folder shown below.

Clicks on your folder where the script is stored.

Search your file and click on this.

Now your output on your browser.

How to modify and run script

If you want to modify that script then open notepad++ and modify your script.

php tutorial

After editing the script save it (Ctrl + s) and refresh your browser.

 Six step of run PHP script

Congratulation, your first script has been modified properly.

Example of first script

Let's create the first script of the php and save it with .php extension.

<?php

echo "Welcome to the php
"; echo "PHP is a scripting language "; echo "
"; echo "It's easy to learn.
"; echo "Php is open source."; ?>

In the above example only echo statement are there that is used for printing the string or variable and br is an html tag, that is used for new line.


QUOTES OF THE DAY

Beauty is truth, Truth beauty- That is all

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER