PHP <ul><li>PHP Stands for " Hypertext Preprocessor ."
PHP is an HTML-embedded Web scripting language.
PHP is an free, open-source server-side scripting language. </li></ul>
<ul><li>PHP is a server-side scripting language for creating dynamic Web pages.
This is the most traditional and main target field for PHP.
To know more about php defintion visit </li></ul>www.phpfordonkeys.com/a719308-php-definition-...
How PHP Works: When a user navigates in her browser to a page that ends with a .php extension, the request is sent to a web server, which directs the request to the PHP interpreter.
Basic PHP Syntax : PHP Tags <ul><li>PHP code must be contained in special tags so that the PHP interpreter can identify it. </li></ul>Depending on the PHP configuration, these tags can take several forms: <?php PHP CODE GOES IN HERE ?> <ul><li>It is known as the XML style, because it can be used inside of an XML document. </li></ul>
HTML OR SCRIPT TAG: <script language="php"> PHP CODE GOES IN HERE </script> ASP-style tags: <% PHP CODE GOES HERE %>
Comments: PHP has two forms of comments: * Single-line comments begin with a double slash (//). * Multi-line comments begin with "/*" and end with "*/". Syntax // This is a single-line comment /* This is a multi-line comment.*/
Variables: PHP variables begin with a dollar sign ($) as shown below. Syntax: $var_name = "Value"; Each php statement must ends with semicolon.
PHP Functions: There are literally hundreds of built-in PHP functions. A function might take zero arguments or several arguments (e.g, mail(), which takes three required and two optional arguments). The syntax for calling a function is straightforward: function_name(arguments);
Sample code:PhpBasics/Demos/PhpInfo.php <html> <head> <title>PHPINFO</title> </head> <body> <?php //Output information on the PHP environment phpinfo(); ?> </body> </html>
The php.ini file <ul><li>The php.ini is the main PHP configuration file . php.ini file controls many aspect of php's behavior.
!-boolean NOT </li></ul>Boolean flags can be turned on using the values 1, On, True or Yes. They can be turned off using the values 0, Off, False or No.
OBJECT ORIENTED FEATURES: PHP scripting language provides object oriented features through the class keyword. We can use the following coding conventions to distinguish between private, public and protected variables: <ul><li>All private variables and functions always start with underscore "_" followed by lowercase letters like var $_myvar; </li></ul>
<ul><li>All Protected variables and functions always start with "_T" followed by lowercase letters like var $_Tmyvar
All Public variables and functions do not start with underscore "_" like var $myvar;
All variables and functions always start with lowercase letter (no uppercase) like var $_myvar; and NOT like var $_Myvar; </li></ul>
visit </li></ul>www.reallylinux.com/docs/php.ini for more syntax
Limitations of PHP : <ul><li>PHP is NOT 100 % pure Object Oriented scripting language. But in near future PHP may support 100% object oriented scripting.
PHP will NOT give the performance of "C" or "C++" language. Because it is scripting language and is interpreted it will be a bit slower than the optimized "C++" programs. </li></ul>
Advantages: <ul><li>We can very rapidly develop web applications in PHP as compile and link is eliminated in PHP scripting language.
PHP will give you the freedom to select any server platform. </li></ul>
<ul><li>PHP has excellent database conectivity to all SQL database servers.
PHP runs on all UNIX'es, linux, Windows 95/NT/2000 and is more powerful than ASP, JSP and others.
PHP has a very large user base and developer base. </li></ul>