SlideShare a Scribd company logo
By
N. Ajay Kumar
Contents
• Introduction
• What is PHP?
• Features
• Uses of PHP
• Where it is used?
• History of PHP
• Implementations
• Basics of PHP
• An Example
• Security Issues
• Conclusion
What is PHP?What is PHP?
• PHP
• PHP: Hypertext Preprocessor
• Originally called “Personal Home Page Tools”
• Popular server-side scripting technology
• Open-source
• Anyone may view, modify and redistribute source
code
• Supported freely by community
• Platform independent 3
• Source-code not visible by client
• ‘View Source’ in browsers does not display the PHP code
• Various built-in functions allow for fast
development
• PHP supports many databases (MySQL,
Informix, Oracle, Sybase, Solid, PostgreSQL,
Generic ODBC, etc.)
• PHP is compatible with almost all servers
used today (Apache, IIS, etc.)
PHP FeaturesPHP Features
• Easy learning
• Syntax Perl- and C-like syntax. Relatively easy to
learn.
• Large function library
• Embedded directly into HTML
• Interpreted, no need to compile
• Open Source server-side scripting language
designed specifically for the web.
PHP Features(cont.)PHP Features(cont.)
• Conceived in 1994, now used on +10 million web
sites.
• Outputs not only HTML but can output XML,
images (JPG & PNG), PDF files and even Flash
movies all generated on the fly. Can write these
files to the file system.
• PHP also has support for talking to other services
using protocols such as LDAP, IMAP, SNMP,
NNTP, POP3, HTTP.
Using PHP you..
• Can performs system functions, i.e. from files on a system
it can create, open, read, write, and close them.
• Can handle forms, i.e. gather data from files, save data to
a file, thru email you can send data, return data to the
user.
• Can add, delete, modify elements within your database
thru PHP.
• Access cookies variables and set cookies.
• Can restrict users to access some pages of website.
• Can encrypt data.
Where it is used..?
• E-Commerce
• Project Management Tools
• Graphical User Interface
• Building an Online Community
• Developing Facebook Applications
• Generating PDF Files
• Mailing Lists
• Image Processing and Generation
Php
History of PHPHistory of PHP
• PHP began in 1995 when Rasmus Lerdorf developed a
Perl/CGI script toolset he called the Personal Home Page
or PHP
• PHP 2 released 1997 (PHP now stands for Hypertext
Processor). Lerdorf developed it further, using C instead
• PHP3 released in 1998 (50,000 users)
• PHP4 released in 2000 (3.6 million domains). Considered
debut of functional language and including Perl parsing,
with other major features
• PHP5.0.0 released July 13, 2004 (113 libraries>1,000
functions with extensive object-oriented programming)
• PHP 6 is yet to released
Implementations
• The PHP language was originally implemented as an interpreter
• Several compilers have been developed which decouple the
PHP language from the interpreter.
• Advantages of compilation include better execution speed,
static analysis, and improved interoperability with code written
in other languages.
• Phalanger, which compiles PHP into Common Intermediate
Language (CIL) byte code, and HipHop, developed at Facebook
and now available as open source, which transforms the PHP
Script into C++, then compiles it, reducing server load up to 50%
• PHP scripts can also be deployed in executable format using
a PHP compiler.
Basics
Basic applications
• Structurally similar to C/C++
• Supports procedural and object-oriented paradigm (to
some degree)
• Scripting delimiters
• <? php ?>
• Must enclose all script code
• Variables preceded by $ symbol
• Case-sensitive
• End statements with semicolon
• Comments
• // for single line
• /* */ for multiline
• Filenames end with .php by convention
13
PHP Operators
•Operators are used to operate on values. There are
four classifications of operators:
• Arithmetic
• Assignment
• Comparison
• Logical
PHP Arrays
In PHP, there are three kind of arrays:
• Numeric array
• Associative array
• Multidimensional array
Control Structures
• Wide Variety available
• if, else, elseif
• while, do-while
• for, foreach
• break, continue, switch
• require, include, require_once, include_once
PHP Hello World
•Above is the PHP source code.
PHP Hello World
•It renders as HTML that looks like this:
Php
Security issues
• About 30% of all vulnerabilities listed on the National
Vulnerability Database are linked to PHP.
• These are caused mostly by not following best practice
programming rules; technical security flaws of the language
itself or of its core libraries are not frequent (23 in 2008,
about 1% of the total).
• Recognizing that programmers make mistakes, some
languages include taint checking to automatically detect the
lack of input validation which induces many issues.
Conclusion
Php
Ad

More Related Content

Similar to Php (20)

Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
Elizabeth Smith
 
Php unit i
Php unit i Php unit i
Php unit i
prakashvs7
 
Introduction to PHP.pptx
Introduction to PHP.pptxIntroduction to PHP.pptx
Introduction to PHP.pptx
MarianJRuben
 
Php intro
Php introPhp intro
Php intro
sana mateen
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
Sleepy Head
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Harshal88
 
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoilec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PedakotaPavankumar
 
Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1
Mohd Harris Ahmad Jaal
 
Welcome to computer programmer 2
Welcome to computer programmer 2Welcome to computer programmer 2
Welcome to computer programmer 2
MLG College of Learning, Inc
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
Sumit Biswas
 
web Based Application Devlopment using PHP
web Based Application Devlopment using PHPweb Based Application Devlopment using PHP
web Based Application Devlopment using PHP
maccodder
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Meetendra Singh
 
PHP Training Institute In Delhi.pptx
PHP Training Institute In Delhi.pptxPHP Training Institute In Delhi.pptx
PHP Training Institute In Delhi.pptx
DivyaSharma84779
 
introduction to php and its uses in daily
introduction to php and its uses in dailyintroduction to php and its uses in daily
introduction to php and its uses in daily
vishal choudhary
 
hyper text preprocessor presentation.pptx
hyper text preprocessor  presentation.pptxhyper text preprocessor  presentation.pptx
hyper text preprocessor presentation.pptx
daniroba279
 
1. introduction to php and variable
1. introduction to php and variable1. introduction to php and variable
1. introduction to php and variable
NurAliaAqilaMuhalis
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 
How PHP works
How PHP works How PHP works
How PHP works
Atlogys Technical Consulting
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
Elizabeth Smith
 
Introduction to PHP.pptx
Introduction to PHP.pptxIntroduction to PHP.pptx
Introduction to PHP.pptx
MarianJRuben
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Harshal88
 
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoilec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PedakotaPavankumar
 
Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1
Mohd Harris Ahmad Jaal
 
web Based Application Devlopment using PHP
web Based Application Devlopment using PHPweb Based Application Devlopment using PHP
web Based Application Devlopment using PHP
maccodder
 
PHP Training Institute In Delhi.pptx
PHP Training Institute In Delhi.pptxPHP Training Institute In Delhi.pptx
PHP Training Institute In Delhi.pptx
DivyaSharma84779
 
introduction to php and its uses in daily
introduction to php and its uses in dailyintroduction to php and its uses in daily
introduction to php and its uses in daily
vishal choudhary
 
hyper text preprocessor presentation.pptx
hyper text preprocessor  presentation.pptxhyper text preprocessor  presentation.pptx
hyper text preprocessor presentation.pptx
daniroba279
 
1. introduction to php and variable
1. introduction to php and variable1. introduction to php and variable
1. introduction to php and variable
NurAliaAqilaMuhalis
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 

More from Ajay Kumar (6)

Banned bible
Banned bibleBanned bible
Banned bible
Ajay Kumar
 
Hidden files restoring using CMD
Hidden files restoring using CMDHidden files restoring using CMD
Hidden files restoring using CMD
Ajay Kumar
 
Microsoft Surface Tablet
Microsoft Surface Tablet Microsoft Surface Tablet
Microsoft Surface Tablet
Ajay Kumar
 
Bespoke Technique for Secret Messaging
Bespoke Technique for Secret MessagingBespoke Technique for Secret Messaging
Bespoke Technique for Secret Messaging
Ajay Kumar
 
Blue eye tech new
Blue eye tech newBlue eye tech new
Blue eye tech new
Ajay Kumar
 
Param Vir Chakra
Param Vir ChakraParam Vir Chakra
Param Vir Chakra
Ajay Kumar
 
Hidden files restoring using CMD
Hidden files restoring using CMDHidden files restoring using CMD
Hidden files restoring using CMD
Ajay Kumar
 
Microsoft Surface Tablet
Microsoft Surface Tablet Microsoft Surface Tablet
Microsoft Surface Tablet
Ajay Kumar
 
Bespoke Technique for Secret Messaging
Bespoke Technique for Secret MessagingBespoke Technique for Secret Messaging
Bespoke Technique for Secret Messaging
Ajay Kumar
 
Blue eye tech new
Blue eye tech newBlue eye tech new
Blue eye tech new
Ajay Kumar
 
Param Vir Chakra
Param Vir ChakraParam Vir Chakra
Param Vir Chakra
Ajay Kumar
 
Ad

Recently uploaded (20)

SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Ad

Php

  • 2. Contents • Introduction • What is PHP? • Features • Uses of PHP • Where it is used? • History of PHP • Implementations • Basics of PHP • An Example • Security Issues • Conclusion
  • 3. What is PHP?What is PHP? • PHP • PHP: Hypertext Preprocessor • Originally called “Personal Home Page Tools” • Popular server-side scripting technology • Open-source • Anyone may view, modify and redistribute source code • Supported freely by community • Platform independent 3
  • 4. • Source-code not visible by client • ‘View Source’ in browsers does not display the PHP code • Various built-in functions allow for fast development • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.) • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • 5. PHP FeaturesPHP Features • Easy learning • Syntax Perl- and C-like syntax. Relatively easy to learn. • Large function library • Embedded directly into HTML • Interpreted, no need to compile • Open Source server-side scripting language designed specifically for the web.
  • 6. PHP Features(cont.)PHP Features(cont.) • Conceived in 1994, now used on +10 million web sites. • Outputs not only HTML but can output XML, images (JPG & PNG), PDF files and even Flash movies all generated on the fly. Can write these files to the file system. • PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP.
  • 7. Using PHP you.. • Can performs system functions, i.e. from files on a system it can create, open, read, write, and close them. • Can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user. • Can add, delete, modify elements within your database thru PHP. • Access cookies variables and set cookies. • Can restrict users to access some pages of website. • Can encrypt data.
  • 8. Where it is used..? • E-Commerce • Project Management Tools • Graphical User Interface • Building an Online Community • Developing Facebook Applications • Generating PDF Files • Mailing Lists • Image Processing and Generation
  • 10. History of PHPHistory of PHP • PHP began in 1995 when Rasmus Lerdorf developed a Perl/CGI script toolset he called the Personal Home Page or PHP • PHP 2 released 1997 (PHP now stands for Hypertext Processor). Lerdorf developed it further, using C instead • PHP3 released in 1998 (50,000 users) • PHP4 released in 2000 (3.6 million domains). Considered debut of functional language and including Perl parsing, with other major features • PHP5.0.0 released July 13, 2004 (113 libraries>1,000 functions with extensive object-oriented programming) • PHP 6 is yet to released
  • 11. Implementations • The PHP language was originally implemented as an interpreter • Several compilers have been developed which decouple the PHP language from the interpreter. • Advantages of compilation include better execution speed, static analysis, and improved interoperability with code written in other languages. • Phalanger, which compiles PHP into Common Intermediate Language (CIL) byte code, and HipHop, developed at Facebook and now available as open source, which transforms the PHP Script into C++, then compiles it, reducing server load up to 50% • PHP scripts can also be deployed in executable format using a PHP compiler.
  • 13. Basic applications • Structurally similar to C/C++ • Supports procedural and object-oriented paradigm (to some degree) • Scripting delimiters • <? php ?> • Must enclose all script code • Variables preceded by $ symbol • Case-sensitive • End statements with semicolon • Comments • // for single line • /* */ for multiline • Filenames end with .php by convention 13
  • 14. PHP Operators •Operators are used to operate on values. There are four classifications of operators: • Arithmetic • Assignment • Comparison • Logical
  • 15. PHP Arrays In PHP, there are three kind of arrays: • Numeric array • Associative array • Multidimensional array
  • 16. Control Structures • Wide Variety available • if, else, elseif • while, do-while • for, foreach • break, continue, switch • require, include, require_once, include_once
  • 17. PHP Hello World •Above is the PHP source code.
  • 18. PHP Hello World •It renders as HTML that looks like this:
  • 20. Security issues • About 30% of all vulnerabilities listed on the National Vulnerability Database are linked to PHP. • These are caused mostly by not following best practice programming rules; technical security flaws of the language itself or of its core libraries are not frequent (23 in 2008, about 1% of the total). • Recognizing that programmers make mistakes, some languages include taint checking to automatically detect the lack of input validation which induces many issues.