Wednesday, February 6, 2013

How to Write a Hello World Program in PHP


Hypertext Preprocessor is a widely used, it is a Programming and general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. PHP 5+ version fully supports OOP programming. There are plenty of PHP frameworks which can be used for rapid development of web applications. CakePHP, Zend, Codeigniter, Smarty are few examples of them.

Before going into “Hello World” programme of PHP, install WAMP in windows platform.
Download WAMP from net and install in your system.
After installation you can see a ‘www’ folder(wamp\www) in WAMP installed folder.
All PHP files should be inside of ‘www’ folder.
  • PHP coding starts with <?php and ends with ?>.
  • A PHP file is combination of html tags and PHP code.
    • Write the codes such as:
      • <?php
      • echo “Hello World”;
      • ?>
Each code line in PHP ends with a semicolon(;).
Echo and print are basically used for displaying information in browser.
Save it. The PHP file must be saved with .php extension.

No comments:

Post a Comment