Recent Articles
more...    [all articles]
Related Links
Your First Php Program
Posted By - Ko Ko - May 19, 2006

Summary :
Here I will tell you how to write your very first PHP program
Printer Friendly Page
Show Myanmar Version show-myanmar-font

Your First Php Program

Before writing our very first Php program a short explanation about Php tags will be needed.

Php code can be freely mixed with html codes.

When html code ends and php code started you have to type in the "php start tag".

Also when the php code ends and html code started again, the "php end tag" have to be type in again.

Various pairs of "php start tag" and "php end tag" are shown below:-

PHP Start and End Tags

Tag Style

Start Tag

End Tag
Standard tags <?php ?>
Short tags <? ?>
ASP tags <% %>
Script tags <script language="php"> </script>

See below how these 4 pairs of Php Tag are used:-

put your php code here;
put your php code here;
put your php code here;
<script language="php">
put your php code here;

Now lets write our first php program.

Open MS Notepad and type the code shown below. Observe carefully how the start and end tags were used.

echo "Hello World!";


Save as "hello.php" in folder "www" shown below.

Now close the notepad and open the browser.

In the address box type in http://localhost/hello.php and click enter.

If you have done everything properly, you will see "Hello World!" as shown below.

Congratulation, you have written your first php program successfully.

Posted as - [programming] [php]

End of Article - Your First Php Program

0 comment

Leave your comment


You can type in both English and Myanmar (Use Zawgyi Font)

<< Type above word in this box

PHP Training
Php Snippets
Feedback (In Eng and Myan)