What Is PHP?
This section describes what is PHP language and what are main features supported in PHP 5.4.3.
What Is PHP?
PHP stands for PHP: Hypertext Preprocessor, a recursive acronym.
It is mainly a Web server side scripting language.
But it can also be used for other purposes.
PHP was originally created by Rasmus Lerdorf in 1995 as a simple Web page generation tool named as
PHP/FI (Personal Home Page/Forms Interpreter). Today it becomes the number one of server side scripting languages.
Here is a comparison of number of matches on Google for different popular script key words:
Key words Number of matches
"PHP scripting" 400,000
"perl scripting" 371,000
"ASP scripting" 30,900
"JSP scripting" 17,500
"ASP.NET scripting" 14,100
Main features of PHP:
- Web application features - PHP support most commonly used Web application features like: HTTP Cookie,
Session, File Upload, etc.
- CLI (Command-Line Interface)- PHP is commonly used to write Web applications to be integrated to Web servers
using the Common Gateway Interface (CGI). But PHP can also be used to write standalone applications
to be executed by the CLI (Command-Line Interface).
- Data types - PHP supports many data types like other programming languages:
signed and unsigned integers, floating numbers, strings, resources, null, etc.
- File I/O - PHP supports most commonly used file I/O features like local file and path management, remote resource
access using Internet protocols like HTTP and FTP.
- Safe mode - PHP supports a safe mode with many built-in functions restricted or disabled.
- Pre-compilation - PHP Web applications are usually deployed in source code, which will be
interpreted on-the-fly when Web requests arrive to the server. But PHP Web applications can also be
pre-compiled and deployed in executable format to speed up Web requests response time.
- Object-oriented programming - PHP supports object-oriented programming features like object references,
private and protected member variables and methods, abstract and final classes and methods, constructors and destructors,
- Built-in modules - The standard PHP build comes with many free and open source libraries included as built-in modules
for calendar dates handling, FTP protocol support, XML processing, encryption and decryption,
ODBC support, ZIP support, regular expression support, etc.
- Extensions - A large collection of PHP extensions are available to add functionalities to the standard PHP build.
Examples of PHP extensions are Windows API, process management on Unix OS, multibyte string support,
cURL (client-side URL transfer), image manipulation, data compression, database access, Web service, etc.
PHP major releases:
7.0 3 December 2015
6.x Not released
5.6 28 August 2014
5.4 1 March 2012
5.3 30 June 2009
5.0 13 July 2004
4.0 22 May 2000
3.0 6 June 1998
2.0 1 November 1997
1.0 8 June 1995
Last update: 2016.
Table of Contents
About This Book
►Introduction and Installation of PHP 7.0
►What Is PHP?
Downloading and Installing PHP 7.0 for Windows
"php -help" - Command Line Options
"php -m" - Built-in Modules
"php -i" - PHP Engine Information
php.ini - PHP Runtime Configuration
Hello.php - My First PHP Script
Downloading and Installing PHP Documentation
PHP Script File Syntax
PHP Data Types and Data Literals
Variables, References, and Constants
Expressions, Operations and Type Conversions
Conditional Statements - "if" and "switch"
Loop Statements - "while", "for", and "do ... while"
Function Declaration, Arguments, and Return Values
Arrays - Ordered Maps
Configuring and Sending out Emails
Retrieving Information from HTTP Requests
Creating and Managing Sessions in PHP Scripts
Sending and Receiving Cookies in PHP Scripts
Controlling HTTP Response Header Lines in PHP Scripts
MySQL Server Connection and Access Functions
Functions to Manage Directories, Files and Images
SOAP Extension Function and Calling Web Services
SOAP Server Functions and Examples
Localization Overview of Web Applications
Using Non-ASCII Characters in HTML Documents
Using Non-ASCII Characters as PHP Script String Literals
Receiving Non-ASCII Characters from Input Forms
"mbstring" Extension and Non-ASCII Encoding Management
Managing Non-ASCII Character Strings with MySQL Servers
Introduction of Class and Object
Integrating PHP with Apache Web Server
PDF Printing Version