SlideShare une entreprise Scribd logo
1  sur  13
PHP
G. SASIKUMAR
DEPARTMENT OF COMPUTER SCIENCE
OUTLOOK







INTRODUCTION
USAGE
A SAMPLE
CODE OUTPUT
DATA TYPES
SPEED
OPTIMIZATION
RESOURCES
INTRODUCTION
WHAT IS PHP?

PHP is a scripting langauge that was originally designed for web
developement to produce dynamic webpages

For this purpose, PHP code is embedded into HTML

PHP was created by Rasmus Lerdrof in 1995

PHP originally stood for ”PERSONAL HOME PAGE”
USAGE
PHP is a general-purpose scripting language that is especially
suited to server-side web development where PHP generally
runs on a web server
PHP code in a requested file is executed by the PHP runtime, usually
to create dynamic web page content
PHP is also used for command-line scripting and client-side GUI
applications
PHP can be deployed on most web servers, many operating systems
and platforms, and can be used with many relational database
management systems
A SMALL SAMPLE CODE
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
echo "Hello World";
?>
</body>
OUTPUT
Here the output is ”Hello World”.

PHP only parses code within its delimiters. Anything outside its
delimiters is sent directly to the output and is not processed by
PHP

The most common delimiters are
<?php to open and ?>
<script language="php">
</script>
<?= (which is used to echo back a string or variable) and ?>
<% or <%= and %>.
DATA TYPES

PHP stores whole numbers in a platform-dependent range

This range is typically that of 32-bit signed integers. Unsigned
integers are converted to signed values in certain situations
 Arrays can contain elements of any type that handle in PHP

Including resources, objects, and even other arrays

PHP also supports strings, which can be used with single quotes,
double quotes, or heredoc syntax
SPEED OPTIMIZATION

PHP scripts are stored as human-readable source code and are
compiled on-the-fly to an internal format that can be executed by
the PHP engine

Code optimizers aim to reduce the runtime of the compiled code by
reducing its size and making other changes that can reduce the
execution time with the goal of improving performance
RESOURCES

PHP includes free and open source libraries

PHP is a fundamentally Internet-aware system

Many database servers, embedded SQL libraries such as
embedded PostgreSQL, MySQL and SQLite, LDAP servers, and
others

PHP allows developers to write extensions in C to add functionality
to the PHP language

These can then be compiled into PHP or loaded dynamically at runtime
LOGO OF PHP
p














Usual file extensions .php, .phtml .php5 .phps
Paradigm imperative, object-oriented
Appeared in :1995[1]
Designed by :Rasmus Lerdorf
Developer :The PHP Group
Stable release 5.2.13 / 5.3.2 (5.2.13 February 25, 2010; 37 days ago (2010-02-25) / 5.3.2:
March 4, 2010; 30 days ago (2010-03-04))
Typing discipline Dynamic, weak
Major implementations Zend Engine, Roadsend PHP, Phalanger, Quercus, Project Zero,
HipHop
Influenced by C, Perl, Java, C++, Tcl[1]
Influenced PHP4Delphi
Programming language : C
OS : Cross-platform
License :PHP License
Website :http://www.php.net
A scripting or script language is a programming language that supports scripts:
programs written for a special run-time environment that automate the
execution of tasks that could alternatively be executed one-by-one by a human
operator. Scripting languages are often interpreted (rather than compiled)
A server-side dynamic web page is a web pagewhose construction is
controlled by an application server processing server-side scripts. In server-
side scripting, parameters determine how the assembly of every new web
page proceeds, including the setting up of more client-side processing
"Static" means unchanged or constant, while "dynamic" means changing or
lively. Therefore, static Web pagescontain the same prebuilt content each
time the page is loaded, while the content of dynamic Web pages can be
generated on-the-fly. Standard HTML pages arestatic Web pages
When using the PCRE functions, it is required that the pattern is enclosed
bydelimiters. A delimiter can be any non-alphanumeric, non-backslash, non-
whitespace character. Often used delimiters are forward slashes (/), hash signs
(#) and tildes (~)

Contenu connexe

Tendances

Php
PhpPhp
PhpHome
 
Function of PHP in Website Development
Function of PHP in Website DevelopmentFunction of PHP in Website Development
Function of PHP in Website DevelopmentEffOne_Technologies
 
Unit 1-introduction to scripts
Unit 1-introduction to scriptsUnit 1-introduction to scripts
Unit 1-introduction to scriptssana mateen
 
PHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and SimilaritiesPHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and SimilaritiesCloud Analogy
 
Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015iScripts
 
Multilingual Drupal presentation from "Do it With Drupal"
Multilingual Drupal presentation from "Do it With Drupal"Multilingual Drupal presentation from "Do it With Drupal"
Multilingual Drupal presentation from "Do it With Drupal"Gábor Hojtsy
 
Multi language for php with gettext
Multi language for php with gettextMulti language for php with gettext
Multi language for php with gettextBinh Quan Duc
 

Tendances (20)

Php
PhpPhp
Php
 
Function of PHP in Website Development
Function of PHP in Website DevelopmentFunction of PHP in Website Development
Function of PHP in Website Development
 
Introduction to PHP Basics
Introduction to PHP BasicsIntroduction to PHP Basics
Introduction to PHP Basics
 
Training ppt
Training pptTraining ppt
Training ppt
 
What is PHP?
What is PHP?What is PHP?
What is PHP?
 
Php
PhpPhp
Php
 
Word press
Word pressWord press
Word press
 
Unit 1-introduction to scripts
Unit 1-introduction to scriptsUnit 1-introduction to scripts
Unit 1-introduction to scripts
 
Php unit i
Php unit i Php unit i
Php unit i
 
Tech talk webtech
Tech talk webtechTech talk webtech
Tech talk webtech
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Programming language
Programming languageProgramming language
Programming language
 
PHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and SimilaritiesPHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and Similarities
 
Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015
 
Php
PhpPhp
Php
 
Multilingual Drupal presentation from "Do it With Drupal"
Multilingual Drupal presentation from "Do it With Drupal"Multilingual Drupal presentation from "Do it With Drupal"
Multilingual Drupal presentation from "Do it With Drupal"
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Multi language for php with gettext
Multi language for php with gettextMulti language for php with gettext
Multi language for php with gettext
 
PHP
PHPPHP
PHP
 

Similaire à PHP Basics

Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processorSiddique Ibrahim
 
unitI-Introduction to php.pptx
unitI-Introduction to php.pptxunitI-Introduction to php.pptx
unitI-Introduction to php.pptxnehasahuji
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1ADARSH BHATT
 
PHP Hub in Ambala ! Batra Computer Centre
PHP Hub in Ambala ! Batra Computer CentrePHP Hub in Ambala ! Batra Computer Centre
PHP Hub in Ambala ! Batra Computer Centrejatin batra
 
PhP Training Institute In Delhi
PhP Training Institute In DelhiPhP Training Institute In Delhi
PhP Training Institute In DelhiDivyaSharma84779
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfburasyacob012
 
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 Web Development.pdf
PHP Web Development.pdfPHP Web Development.pdf
PHP Web Development.pdfSonia Simi
 
Unit 1 php_basics
Unit 1 php_basicsUnit 1 php_basics
Unit 1 php_basicsKumar
 
Introduction to PHP Part-I
Introduction to PHP Part-IIntroduction to PHP Part-I
Introduction to PHP Part-ISidrah Noor
 
PHP Training In Chandigarh.docx
PHP Training In Chandigarh.docxPHP Training In Chandigarh.docx
PHP Training In Chandigarh.docxExcellence Academy
 
PHP Web Development Language.docx
PHP Web Development Language.docxPHP Web Development Language.docx
PHP Web Development Language.docxLoraGoody
 

Similaire à PHP Basics (20)

Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processor
 
PHP
PHPPHP
PHP
 
How PHP works
How PHP works How PHP works
How PHP works
 
unitI-Introduction to php.pptx
unitI-Introduction to php.pptxunitI-Introduction to php.pptx
unitI-Introduction to php.pptx
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
PHP
PHPPHP
PHP
 
PHP Hub in Ambala ! Batra Computer Centre
PHP Hub in Ambala ! Batra Computer CentrePHP Hub in Ambala ! Batra Computer Centre
PHP Hub in Ambala ! Batra Computer Centre
 
PhP Training Institute In Delhi
PhP Training Institute In DelhiPhP Training Institute In Delhi
PhP Training Institute In Delhi
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
24307183 php
24307183 php24307183 php
24307183 php
 
PHP Web Development.pdf
PHP Web Development.pdfPHP Web Development.pdf
PHP Web Development.pdf
 
PHP
PHPPHP
PHP
 
Php ppt
Php pptPhp ppt
Php ppt
 
Unit 1 php_basics
Unit 1 php_basicsUnit 1 php_basics
Unit 1 php_basics
 
Introduction to PHP Part-I
Introduction to PHP Part-IIntroduction to PHP Part-I
Introduction to PHP Part-I
 
PHP Training In Chandigarh.docx
PHP Training In Chandigarh.docxPHP Training In Chandigarh.docx
PHP Training In Chandigarh.docx
 
PHP Web Development Language.docx
PHP Web Development Language.docxPHP Web Development Language.docx
PHP Web Development Language.docx
 

Dernier

fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Dernier (20)

fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

PHP Basics

  • 3. INTRODUCTION WHAT IS PHP?  PHP is a scripting langauge that was originally designed for web developement to produce dynamic webpages  For this purpose, PHP code is embedded into HTML  PHP was created by Rasmus Lerdrof in 1995  PHP originally stood for ”PERSONAL HOME PAGE”
  • 4. USAGE PHP is a general-purpose scripting language that is especially suited to server-side web development where PHP generally runs on a web server PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content PHP is also used for command-line scripting and client-side GUI applications PHP can be deployed on most web servers, many operating systems and platforms, and can be used with many relational database management systems
  • 5. A SMALL SAMPLE CODE <html> <head> <title>PHP Test</title> </head> <body> <?php echo "Hello World"; ?> </body>
  • 6. OUTPUT Here the output is ”Hello World”.  PHP only parses code within its delimiters. Anything outside its delimiters is sent directly to the output and is not processed by PHP  The most common delimiters are <?php to open and ?> <script language="php"> </script> <?= (which is used to echo back a string or variable) and ?> <% or <%= and %>.
  • 7. DATA TYPES  PHP stores whole numbers in a platform-dependent range  This range is typically that of 32-bit signed integers. Unsigned integers are converted to signed values in certain situations  Arrays can contain elements of any type that handle in PHP  Including resources, objects, and even other arrays  PHP also supports strings, which can be used with single quotes, double quotes, or heredoc syntax
  • 8. SPEED OPTIMIZATION  PHP scripts are stored as human-readable source code and are compiled on-the-fly to an internal format that can be executed by the PHP engine  Code optimizers aim to reduce the runtime of the compiled code by reducing its size and making other changes that can reduce the execution time with the goal of improving performance
  • 9. RESOURCES  PHP includes free and open source libraries  PHP is a fundamentally Internet-aware system  Many database servers, embedded SQL libraries such as embedded PostgreSQL, MySQL and SQLite, LDAP servers, and others  PHP allows developers to write extensions in C to add functionality to the PHP language  These can then be compiled into PHP or loaded dynamically at runtime
  • 11.               Usual file extensions .php, .phtml .php5 .phps Paradigm imperative, object-oriented Appeared in :1995[1] Designed by :Rasmus Lerdorf Developer :The PHP Group Stable release 5.2.13 / 5.3.2 (5.2.13 February 25, 2010; 37 days ago (2010-02-25) / 5.3.2: March 4, 2010; 30 days ago (2010-03-04)) Typing discipline Dynamic, weak Major implementations Zend Engine, Roadsend PHP, Phalanger, Quercus, Project Zero, HipHop Influenced by C, Perl, Java, C++, Tcl[1] Influenced PHP4Delphi Programming language : C OS : Cross-platform License :PHP License Website :http://www.php.net
  • 12. A scripting or script language is a programming language that supports scripts: programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled) A server-side dynamic web page is a web pagewhose construction is controlled by an application server processing server-side scripts. In server- side scripting, parameters determine how the assembly of every new web page proceeds, including the setting up of more client-side processing "Static" means unchanged or constant, while "dynamic" means changing or lively. Therefore, static Web pagescontain the same prebuilt content each time the page is loaded, while the content of dynamic Web pages can be generated on-the-fly. Standard HTML pages arestatic Web pages
  • 13. When using the PCRE functions, it is required that the pattern is enclosed bydelimiters. A delimiter can be any non-alphanumeric, non-backslash, non- whitespace character. Often used delimiters are forward slashes (/), hash signs (#) and tildes (~)