PHP Introduction
PHP is a server-side scripting language which is used for web development. It stands for Hypertext Preprocessor. It is faster than another programming language. It supports multiple databases like MySQL, SQL, PostgreSQL and many more.
History of PHP
PHP was developed by Rasmus Lerdorf in 1995. It is used to develop a dynamic web application. The earlier name of PHP was a personal homepage.
The PHP code is usually processed by PHP interpreter as a module in the web server or as a Common Gateway Interface (CGI).
Why should we use PHP?
We should use PHP because of various reasons.
- It runs on various platforms like (Windows, Linux Mac, etc.)
- It is compatible with all servers like (Apache, IIS, etc.)
- It supports a wide range of databases.
- It is free.
- It is easy to learn.
Features of PHP
There are various features of PHP that are given below.
- Performance
- Embedded
- Portability (Platform Independent)
- It is easy to use in comparison to other languages.
- It is an open Source programming language.
Hello world program in PHP
Before start PHP, let us take a simple example of a hello world!. We know that PHP is embedded in HTML.
The most common tag of PHP is:
1 2 3 |
<?php ….?>. |
1 2 3 4 5 6 7 8 9 10 |
<html> <head> <title>Hello World</title> </head> <body> <?php echo "Hello, World!";?> </body> </html> |
Output
1 2 3 |
Hello World |
PHP Topics
Core PHP:
- Introduction
- First Program
- PHP Comments
- PHP Variables
- PHP $ and $$ Variables
- PHP Echo and Print
- PHP Data Types
- PHP Strings
- PHP Constants
- PHP Operators
- PHP If Else
- PHP Switch
- PHP While Loop
- PHP For Loop
- PHP For each Loop
- PHP while & Do while
- PHP Array
- PHP Associative Array
- PHP Multidimensional Array
- PHP Array Functions
- PHP Strings
- PHP Forms
- PHP Multiple Inheritance
- PHP Date & Time
- PHP Include & Require
- PHP isset
- PHP Implode
- PHP Explode
- PHP MySQL
Misc