What is PHP?
PHP stands for "Hypertext processor" and was initially called "personal home page". PHP does not charge users, hence it is free to download and use. PHP is designed for web use as a scripting language and works only with web server. Examples are: Apache, IIS, nginx etc. which means that the PHP script only runs in web servers.It is an HTML-embedded scripting language.
Syntax
The opening and closing tags of PHP syntax includes:
Opening tags:
<?php
<?
<script language='php'>
Closing tags:
?>
?> (short tag)
</script>
Note: To use syntax 2 of the closing tags, short tags must be turned "on" in php.ini located at the php.ini file.
To turn this on use: short_open_tag=on
PHP file
The extension of PHP file is (.php). The PHP files contains codes from html, css, java script, user text and php code.
The method of code execution in PHP is called "sever side code" but when the code is executed in a browser it is called "client side code".
Note: Every PHP statements must end with semi-colon (;)
How PHP works?
The PHP parser will find the requested file and would scan it into PHP codes. After the file has been scanned into PHP codes, the parser will execute the code and send the output to the web server. At this point the web server sends the outputs to the web browser which will display the outputs on the screen.
Evolution of PHP
PHP was created by Rasmus Lerdorf in the year 1994, but was released to the general public in the year 1995 and was called PHP Version 2.
In the year 1997, two more developers, Zeev Suraski and Andi Gutmans along with Rasmus Lerdorf rewrote PHP and in June 1998, they released PHP Version 3.0.
From then, other versions were created and released; they include:
- PHP 4 released in May 2000
- PHP 5 launched in July 2004
Advantages of PHP
- It is easy to learn.
- It is fast.
- It is free (no charges attached).
- It runs on so many operating systems, which include:
- Windows
- Mac
- Linux
- Unix
- Solaris
- MS-SQL
- IBM DB2
- MYSqL
- Oracle
- Postgre SQL
- SQLite
PHP comments
Just like commenting in programming, so as users can comment in PHP. A comment is simply a statement, that is ignored by the PHP engine when executing the programme.
The below statement shows how to comment in PHP.
<?php
// This is a single line comment
# This is also a single line comment
/*
This is a multiple line comment
This is a multiple line comment
*/
?>
Comments
Post a Comment