Basic PHP Syntax

October 30, 2008 by: Ranjith

Php codes will starts with <?php and ends with ?>.

Here is the first php program.

<html>
<body>

<?php
echo "MY First PHP Program";
?>

</body>
</html>

Write the above codes in notepad and save it as first.php. Now run the this file on localhost, you should be able to see MY First PHP Program. Here echo is a print command.

Share/Bookmark:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Furl
  • StumbleUpon
  • Technorati
  • email
Similar posts:

Comments

2 Responses to “Basic PHP Syntax”
  1. lala says:

    hi..may i ask.
    what if i want to output a word that i input to a textbox.
    then i click submit..
    the result must be the word that i wrote in the textbox..

    example:
    txt1 hello
    txt2 world
    click submit

    output must be
    hello
    world..

    how to do it?…thank you for your response…
    thank you..

  2. Lali says:

    lala teri ma ka bhosda……

Leave a Reply