PHP Basics

     PHP(Php Hypertext Preprocessor) is a server-side scripting language which is popular and mostly used by web applications developer because of it's efficient libraries. And since PHP is open-source, many web developers choose it for it's no cost usage.
     Here are some basic PHP codes for starters.
     To create a PHP script, we must create a PHP tag. A tag which will be used to write PHP codes in it. 
<?php
// write your PHP codes here
?>
      Since PHP is a server-side scripting language, the code above will be read by the server and will become an HTML code after. I mean when you run a PHP script in your server, eventually when you view the page source of your script you will see all HTML tags.



PHP stands for PHP: Hypertext Preprocessor, with that PHP standing for Personal HomePage [Tools]. This type of acronym is known as a retronym. Originally, in 1994, the language was designed as a small set of binaries used to collect some basic site traffic data. In 1997 the parser was rewritten by two Israelis and the name was changed to the current acronym — it being determined that hypertext preprocessor was a decidedly more acceptable name in the business world.
PHP is an open-source language, used primarily for dynamic web content and server-side applications. It is often pointed to as the main competitor with: 
  • Microsoft's C# - Visual Basic.NET - ASP family,
  • Sun's Java - JSP
  • Macromedia's ColdFusion
  • CGI - Perl
     PHP has many open-source libraries included with the core build, and many more are readily available. Extensions exist to help PHP interface with a number of systems, including IRC, a number of compression formats, and Windows API. Other extensions exist to let PHP generate file formats on-the-fly, such as a popular extension which allows PHP to create Macromedia Flash movies.
     Since version 3, PHP has integrated object oriented features. Version 5 built substantially on this limited functionality, and PHP now has robust object oriented capabilities, including interfaces, exceptions, destructions, and abstracts.
     PHP reached wide-spread popularity with version 4, released in 2000. In 2004 PHP 5 was debuted, and it is now considered one the top languages used for server-side scripting.
No doubt much of its popularity is due to its relative ease to learn, and its notorious looseness. Arrays and variables in PHP are able to hold any type of object, variables need not be declared, and the syntax is remarkably simple.
     Unlike many languages, such as C# or Perl, which have primarily a following of more generalist programmers, many PHP programmers know no other language. This occasionally causes it to be dismissed as a lesser language, but its growing popularity and the many robust and efficient sites built using it as a structure seem to dispel this myth.
     PHP has occasionally been criticized for what are viewed by some as security flaws, in comparison to languages such as ASP. A lack of easily understandable error messages, a sometimes overly robust configuration file, and an obviously incomplete set of built-in functions are also pointed to as areas which could use marked improvement.  



Requirements:
     To create an php environment you need to have Web Server:
following are the list of Web Servers:
  • IIS
  • Apache
  • Zeus


      Then you need to have PHP as platform.
PHP version compatibility:
  • PHP 5 is highly recommended
  • Gallery 2.4 (due in 2008) will require PHP 5.2 or later.


      Compatible Database:
  • DB2
  • MSSQL
  • MySQL
  • Oracle
  • PostgreSQL
     Or use a package where apache, mysql and php are compressed for specific platform:
  • WAMP - Windows, Apache, MySQL and PHP
  • LAMP - Linux, Apache, MySQL and PHP
  • MAMP - Mac, Apache, MySQL and PHP
  • XAMPP - Cross-platform