Professional Documents
Culture Documents
1 PHP
1 PHP
1 PHP
What is PHP
Supported
Version Release date Description
until
Officially called "Personal Home
1.0 8 June 1995 Page". This is the first version of
"PHP".
1 November
2.0 Officially called "PHP/FI 2.0".
1997
27
4.3 December 31 March 2005 Introduced the command-line interface (CLI), to supplement the CGI.
2002
4.4 11 July 2005 7 August 2008 Fixed a memory corruption bug
5.0 13 July 2004 5 September 2005 Zend Engine II with a new object model.
24
Performance improvements with introduction of compiler variables. Added PHP Data
5.1 November 24 August 2006
Objects (PDO) as a consistent interface for accessing databases.
2005
2 November
5.2 6 January 2011 Enabled filter extension. JSON Support.
2006
5.5 20 June 2013 10 July 2016 Support for generators, finally blocks for exceptions handling.
Constant scalar expressions, argument unpacking, new exponentiation operator, extensions of the use
5.6 28 August 2014 31 December 2018
statement for functions and constants, and other smaller improvements.
6.x Not released Abandoned version of PHP that planned to include native Unicode support.
64-bit integer support on Windows, uniform variable syntax, return type declarations, scalar type
7.0 3 December 2015 3 December 2018 (integer, float, string and boolean) declarations, <=> 'spaceship' three-way comparison operator and
shorthand syntax for importing multiple items from a namespace.
void return type,
7.1 1 December 2016 1 December 2019 class constant
visibility modifiers.
Counting of non-
7.2 30 November 2017 30 November 2020
countable objects.
support for
reference
7.3 6 December 2018 6 December 2021 assignment and
array deconstruction
with list()
PHP stands for HyperText Preprocessor.
PHP files can contain text, HTML, CSS, JavaScript, and PHP code
PHP files have extension ".php"
PHP code are executed on the server so you need web browser to
execute php code
It is an interpreted language, i.e. there is no need for compilation.
It is a server side scripting language.
It is faster than other scripting language e.g. asp and jsp.
Advantage of php
It is open source.
Widly used in all over the world
To execute php code no need compiler.
PHP costs nothing, it is free to download and use.
PHP is a server-side scripting language and is used for websites and the
web applications.
PHP scripts are executed on the server.
PHP supports a wide range of databases.
PHP runs on various platforms like Linux, Windows, Unix etc.
PHP supports most web servers (for example Apache, IIS).
PHP converses with several network protocols.
Features of PHP
It is most popular and frequently used world wide scripting language, the main reason of
popularity is; It is open source and very simple.
Simple
Faster
Interpreted
Open Source
Case Sensitive
Simplicity
Efficiency
Platform Independent
Security
Flexibility
Familiarity
Error Reporting
Loosely Typed Language
Real-Time Access Monitoring
Simple
It is very simple and easy to use, compare to other scripting language it
is very simple and easy, this is widely used all over the world.
Interpreted
It is an interpreted language, i.e. there is no need for compilation.
Faster
It is faster than other scripting language e.g. asp and jsp.
Open Source
Open source means you no need to pay for use php, you can free
download and use.
Platform Independent
PHP code will be run on every platform, Linux, Unix, Mac OS X, Windows.
Case Sensitive
PHP is case sensitive scripting language at time of variable declaration.
In PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions,
and user-defined functions are NOT case-sensitive.
Error Reporting
PHP have some predefined error reporting constants to generate a
warning or error notice.
Real-Time Access Monitoring
PHP provides access logging by creating the summary of recent
accesses for the user.
Loosely Typed Language
PHP supports variable usage without declaring its data type. It will be
taken at the time of the execution based on the type of data it has on
its value.
Uses of php
You can run php code on any web browser. PHP script is executed
on the server, and the plain HTML result is sent back to the browser.
Basic Syntax of PHP
PHP code is start with <?php and ends with ?>
Every PHP statements end with a semicolon (;).
PHP code save with .php extension.
PHP contain some HTML tag and PHP code.
You can place PHP code any where in your document.
Simple Example of
PHP
In PHP, all keywords (e.g. if, else, while, echo, etc.), classes,
functions, and user-defined functions are NOT case-sensitive.
However all variable names are case-sensitive.
Example: Echo Keyword
can be written in following
ways: Example: Variable
<?php <?php
echo "echo keyword in lower letter <br>"; $name="Rasmus Lerdorf";
Echo "Echo keyword in sentance case $dob="22 November 1968";
<br>";
$YEAR="1995";
EcHo "EcHo keyword in mixed case <br>";
echo "PHP Developed By $name in $year
ECHO "ECHO keyword in capital case <br>";
<br>";
echo "DOB of $NAME is $dob";
?>
?>
Output:
Output:
echo keyword in lower letter
Echo keyword in sentance case PHP Developed By Rasmus Lerdorf in
EcHo keyword in mixed case DOB of is 22 November 1968
ECHO keyword in capital
Comments in PHP