Introduction to PHP
History of PHP
Some Facts about the language
“
PHP is one of the most widely used and
recognizable technologies in use on
the internet. Originally PHP stood for
"Personal Home Page", though more
recently it has been changed to stand for
"PHP: Hypertext Preprocessor".
3
Rasmus Lerdorf
PHP development began in 1994 as a
personal project of Rasmus Lerdorf, who had
created a series of Perl scripts which he
referred to as his "Personal Home Page
Tools" for the maintenance of his personal
web page.
4
After being released to the world at
large, PHP underwent rapid refinement
and development, with the second
version of PHP/FI being released a mere
two years later in November of 1997.
PHP 3 was released in 1998, with PHP 4
and PHP 5 following in 2000 and 2004,
respectively.
5
One important thing to remember
about PHP is that it is a pre-
processor, which means that any PHP
scripts in a web page are executed
before the page is displayed. This
means that any PHP scripts in a page
are unable to change that page after
it has been displayed.
6
There are multiple ways to work
around this limitation, such as
AJAX (Asynchronous Java Script
and XML), which will allow you to
change what is on a page without
refreshing the entire page.
7
The most common use of PHP is to
access a database, parse the results
from that database, and display the
results on a web page. This is why
PHP is the final part of the common
acronym "LAMP", which stands for
"Linux, Apache, MySQL, and PHP".
8
“
▫ PHP is a powerful language that has
become one of the driving forces of the
internet, and anyone who is considering
a career in web development should
make learning PHP a priority.
9
“
Server-Side Applications
▫ used to deliver a better experience to the users.
▫ Amazon.com uses it to find the book you are looking
for.
▫ Yahoo! Uses it to store personal preferences
▫ eBay uses it to process your credit card.
10
“
• Server-side scripts run on the web server, usually a
powerful UNIX or Microsoft Windows System.
• They can be used to access resources such as
databases or external files and perform more
sophisticated tasks than regular client-side scripting.
▫ Ex. A server-side script could store a user’s shopping cart in a
database, retrieve it on the user’s next visit to save him some time
reselecting items for purchases.
11
“
These are among the things you can do with
server-side scripts and an RDBMS
▫ Build a search engine that responds to user queries
▫ Record user input provided through web forms and save it for future
reference
▫ Create web site that dynamically update themselves with new content
▫ Manage a blog
▫ Process electronic payments and track customer orders
▫ Build customized graphs, charts, and other statistical reports from raw
numeric data
▫ Carry out online surveys and polls, and create reports of the result
12
“
The main goal of PHP is to allow web
developers to write dynamically
generated web pages quickly.
13
PHP
Underlying concepts
14
“
PHP (Hypertext Preprocessor) is an open-source
HTML-embedded server-side scripting language
which is used to develop dynamic and interactive
web applications and also used as a general-
purpose programming language.
15
What is PHP?
▫ PHP is a recursive acronym for "PHP: Hypertext
Preprocessor".
▫ PHP is a server side scripting language that is
embedded in HTML. It is used to manage dynamic
content, databases, session tracking, even build
entire e-commerce sites.
16
What is PHP?
▫ It is integrated with a number of popular databases,
including MySQL, PostgreSQL, Oracle, Sybase,
Informix, and Microsoft SQL Server.
▫ PHP is pleasingly zippy in its execution, especially
when compiled as an Apache module on the Unix
side. The MySQL server, once started, executes even
very complex queries with huge result sets in record-
setting time.
17
What is PHP?
▫ PHP is forgiving: PHP language tries to be as
forgiving as possible.
▫ PHP Syntax is C-Like.
18
Common uses of PHP
▫ PHP performs system functions, i.e. from
files on a system it can create, open, read,
write, and close them.
▫ PHP can handle forms, i.e. gather data from
files, save data to a file, through email you
can send data, return data to the user.
19
Common uses of PHP
▫ You add, delete, modify elements within your
database through PHP.
▫ Access cookies variables and set cookies.
▫ Using PHP, you can restrict users to access
some pages of your website.
▫ It can encrypt data.
20
Some Facts About PHP
▫ Many syntaxes of PHP is similar to C, Java,
and Perl, and has many unique features and
specific functions.
▫ PHP page is a file with a .php extension that
contains could be the combination of HTML
Tags and PHP scripts.
21
Some Facts About PHP
▫ PHP supports many databases (MySQL and
PHP combination is widely used).
▫ PHP is an open source scripting language.
▫ PHP is free to download and use.
22
“
WHY USE PHP?
23
Features
• As a programming on the web, PHP is hard to ignore.
• Clean syntax, OOP fundamentals, an extensible
architecture that encourages innovation.
• Support for both current and upcoming technologies
and protocols, and excellent database integration are
just some of the reasons for the popularity.
24
Simplicity
▫ It uses a consistent and logical syntax, and comes
with a clearly written manual.
▫ KISS (Keep It Simple Stupid) principle
25
Portability
▫ It works on different platforms.
▫ Cross platform
26
OPEN SOURCE
▫ Because it is free
▫ Ensure faster bug fixes and quicker integration of
new technologies into the core language.
27
Extensible
▫ Enables developers to easily add support for new
technologies to the language
▫ Keeps PHP fresh and always at the cutting edge of
new technology
28
XML and Database Support
▫ It can create a XML file that is treated like a regular
database with tables, fields and records.
29
The XAMPP development framework
30
What You Can Do with PHP?
▫ PHP is used to create web applications, and
some of the most popular web applications
like Facebook, Yahoo, Wikipedia, Twitter,
WordPress all has been developed in PHP,
and you can also develop next big thing by
using PHP.
31
First ever tweet on Twitter
32
Countries with the highest number of
internet users as of June 2019(in
millions)
33
Why PHP? Popular Features
of PHP
34
Features
▫ The best things ▫ Learning PHP ▫ PHP works on
about using is very easy, many operating
PHP is systems such
extremely easy
and it runs as Linux,
for a newcomer, efficiently on Windows, Mac
and also it has server-side. OS X.
many advanced
features for a
professional
programmer.
Features
▫ PHP is FREE ▫ PHP supports ▫ PHP can
to download many dynamically
databases generate HTML,
from the like MySQL, MS PDF, Flash,
official PHP SQL, Oracle, Text,
resource: php Sybase, CSV, XML and
.net PostgreSQL and many others.
many others.
36
Features
▫ Coding in ▫ Many good ▫ Many web
PHP is easy PHP hosting
and fast, so it frameworks options are
takes less like Zend, available at
time to build Codeigniter, the fair price
an and Laravel with PHP.
application. are available
in PHP.
37
Features
▫ With PHP ▫ Substantial
code PHP
deployment community
is very easy. support, and
many tutorials
and sample
programs are
available
online.
38
How to compile or interpret
▫ Php is an interpreted
language (like Perl) and not
a compiled one (like Java).
39