PHP (recursive acronym for : Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
An introductory example
<html> <head> </head> <body> <?php echo "My first php script"; ?> </body> </html>
What is PHP?
- It is a widely-used, open source scripting language
- It scripts are executed on the server
- It is free to download and use
A script can be placed anywhere in the document.A script starts with :
<?php // PHP code goes here ?>
Creating and declaring variables
In PHP, a variable starts with the $ sign, followed by the name of the variable:
<?php $x=10; //variable $txt="Hellow world"; ?>
More about PHP:
- It can generate dynamic page content and can create, open, read, write, delete, and close files on the server.It can collect form data.It can send and receive cookies
- Can add, delete, modify data in your database. It can be used to control user-access
and it can also encrypt data
- Fast and easy to learn and use
- Can run on many platforms, including Windows, Linux and Mac, it’s easy for users to find hosting service providers.It is compatible with all servers like (Apache, IIS, etc.)
- It supports a wide range of databases
- Open source. Download it from the official resource: www.php.net.
PHP is free software released under the License, which stipulates that: Products derived from this software may not be called “PHP”, nor may it appear in their name, without prior written permission from firstname.lastname@example.org.This restriction on use of it makes the License incompatible with the General Public License (GPL), while the Zend License is incompatible due to an advertising clause similar to that of the original BSD license.