SlideShare a Scribd company logo
Prepared by: 
Chandan Das 
B.Tech 5th Semester 
Dept of CSE 
CIT , KOKRAJHAR
INTRODUCTION 
• It is an interpreted, server-side scripting language. 
• Originally designed for web development. 
• Similar languages are Perl, ASP.NET, Ruby, JSP (Java 
Server Pages) 
• Embedded into HTML 
• Can use DB (MySQL, Oracle, Microsoft SQL, Postgre 
SQL)
PHP stands for?? 
Personal Home Page
PHP
HISTORY 
• Began in 1994 by Rasmus Lerdorf 
• Soon he named PHP/FI to build simple, dynamic web 
applications. 
• In 1995 -the release of PHP/FI as "Personal Home Page 
Tools (PHP Tools) version 1.0". 
• In 1997 Zeev Suraski and Andi Gutmans rewrote 
the parser and formed the base of PHP 3, changing the 
name PHP: Hypertext Preprocessor. 
• On May,2000, PHP 4 was released, 
• On July , 2004, PHP 5 was released, powered by the new 
Zend Engine II. 
• In 2008 PHP 5 became the only stable version under 
development. 
• Finally after a vote the current version released in 2014 .
SCRIPTING LANGUAGE
SCRIPTING LANGUAGE 
• A scripting language is: 
– cross-platform since interpreter is easy to port 
– implicit variable declaration 
– compiled on demand 
– Extending 
– Glue programming
HOW PHP WORKS??
PHP
PHP
PHP
PHP
PHP
PHP
PHP
PHP
BASIC PHP SYNTAX 
<?php 
?>
VARIABLES IN PHP 
• All variables in PHP start with a $ sign symbol. 
• Variables may contain strings, numbers, or arrays. 
<html> 
<body> 
<?php $txt="Hello World"; echo $txt; 
?> 
</body> 
</html>
DATA TYPES 
• String 
$name=“x” 
– 'My name is x.' 
– "My name is $name." 
• Boolean 
• Integer 
• Floating point 
• Array 
– $a=array("tokyo", "hanoi", "london") 
– $a=array("japan" => "tokyo", "vietnam" => 
"hanoi", "england" => "london") 
– $a[2] 
– $a["vietnam"]
STRING HANDLING 
• String literals (constants) enclosed in double quotes “ ” 
or single quotes ‘ ’ 
• Within “”, variables are replaced by their value: – called 
variable interpolation. “My name is $name, I think” 
• Strings are concatenated (joined end to end) with the 
dot operator “key”.”board” == “keyboard”
THE IF...ELSE STATEMENT 
Syntax 
if (condition) 
code to be executed if condition is true; 
else 
code to be executed if condition is false;
Syntax 
switch (expression) 
{ 
case label1: code to be executed if expression = 
label1; break; 
case label2: code to be executed if expression = 
label2; break; 
default: code to be executed if expression 
is different from both label1 
and label2; 
} 
THE SWITCH STATEMENT
PHP FUNCTION 
• Strlen(); 
• Strcmp(); 
• Date(); 
• Time(); 
• Include(); 
• Require();
STATE MANAGEMENT 
• It is used to help web 
applications to maintain 
their state across several 
HTTP requests when 
needed. 
• Cookies 
• Session
SESSION 
• Better option of cookie 
• Store information about a user. They 
are available only for a particular 
application and hold information of 
only one single user.
Syntax: 
<?php start_session(); ?>
<?php start_session(); 
$_SESSION[‘user_name’]=‘’ 
$_SESSION[‘pwd’]=‘’ 
?> //create a session
PHP
select username,password 
From table 
Where username=‘textbox1’ and 
password=‘textbox2’
PHP
<?php start_session(); 
$_SESSION[‘user_name’]= 
$_SESSION[‘pwd’]= 
if(isset($_SESSION[‘username’])) 
Echo “Welcome”. $_SESSION[‘name’] 
?> //retrieve a session
• session_destroy(); 
• unset(); 
<?php start_session(); 
$_SESSION[‘user_name’]= 
if(isset($_POST[“lgt_btn"])) 
unset($_SESSION[‘user_name’]); 
?> Name of the 
Logout button
PHP
FEATURES OF PHP 
– Support for MySQL, Oracle, dbm, DB2, 
PostgreSQL 
– Can connect to any database which 
provides an ODBC driver (Open Database 
Connectivity Standard) – e.g. MS Access. 
– Supported on Windows, Mac OS X, other 
Unix-like systems (e.g. Linux). 
– Similar syntax and features as C++ and Java. 
– PHP designer,Wampp/Xampp are free of 
cost.
REFERENCES 
• Wikipedia 
• Google images 
• www.w3schools.com
THANK YOU

More Related Content

PPTX
PHP Basics and Demo HackU
ODP
PPT
Php basic for vit university
PDF
Php converted pdf
PDF
basic concept of php(Gunikhan sonowal)
PPTX
Python assignment help
PDF
Php workshop L03 superglobals
PHP Basics and Demo HackU
Php basic for vit university
Php converted pdf
basic concept of php(Gunikhan sonowal)
Python assignment help
Php workshop L03 superglobals

What's hot (19)

DOC
Php Server Var
PPTX
Introduction To Power Shell
PDF
Php workshop L04 database
PPTX
PowerShell 101
PDF
Nette framework (WebElement #28)
PPTX
SHELL PROGRAMMING
PDF
2018 05-11 the way we teach tech - phpday
PPTX
Php Training Workshop by Vtips
PPT
17 sessions
PPTX
Getting Started with Microsoft Bot Framework
PPTX
Word Play in the Digital Age: Building Text Bots with Tracery
PDF
An Introduction to Symfony
PPTX
Web application, cookies and sessions
PDF
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
PDF
Unix shell scripting tutorial
PPTX
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
PDF
Development of Ansible modules
Php Server Var
Introduction To Power Shell
Php workshop L04 database
PowerShell 101
Nette framework (WebElement #28)
SHELL PROGRAMMING
2018 05-11 the way we teach tech - phpday
Php Training Workshop by Vtips
17 sessions
Getting Started with Microsoft Bot Framework
Word Play in the Digital Age: Building Text Bots with Tracery
An Introduction to Symfony
Web application, cookies and sessions
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Unix shell scripting tutorial
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Development of Ansible modules
Ad

Viewers also liked (8)

PDF
PPT
Introduction to PHP
PPTX
Data types in php
PPT
Introduction to PHP Basics
PPT
How PHP Works ?
PPT
The Php Life Cycle
PPT
Beginners PHP Tutorial
DOCX
Free PHP Book Online | PHP Development in India
Introduction to PHP
Data types in php
Introduction to PHP Basics
How PHP Works ?
The Php Life Cycle
Beginners PHP Tutorial
Free PHP Book Online | PHP Development in India
Ad

Similar to PHP (20)

PPTX
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
PPTX
PHP Hypertext Preprocessor
PPT
PHP and MySQL.ppt
PPT
10_introduction_php.ppt
PPT
10_introduction_php.ppt
PPT
introduction_php.ppt
PDF
Introduction to PHP - Basics of PHP
PPTX
PHP ITCS 323
PPTX
FYBSC IT Web Programming Unit IV PHP and MySQL
PPTX
introduction to php and its uses in daily
PPT
Learning of Php and My SQL Tutorial | For Beginners
PPT
Php Tutorial | Introduction Demo | Basics
PPT
Php Tutorial
PDF
Php introduction
PPT
Php mysql
PPT
php 1
PPTX
Php basics
PDF
Wt unit 4 server side technology-2
PPTX
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
PHP Hypertext Preprocessor
PHP and MySQL.ppt
10_introduction_php.ppt
10_introduction_php.ppt
introduction_php.ppt
Introduction to PHP - Basics of PHP
PHP ITCS 323
FYBSC IT Web Programming Unit IV PHP and MySQL
introduction to php and its uses in daily
Learning of Php and My SQL Tutorial | For Beginners
Php Tutorial | Introduction Demo | Basics
Php Tutorial
Php introduction
Php mysql
php 1
Php basics
Wt unit 4 server side technology-2
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...

Recently uploaded (20)

PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Institutional Correction lecture only . . .
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
01-Introduction-to-Information-Management.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Lesson notes of climatology university.
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
TR - Agricultural Crops Production NC III.pdf
GDM (1) (1).pptx small presentation for students
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Microbial disease of the cardiovascular and lymphatic systems
Institutional Correction lecture only . . .
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
01-Introduction-to-Information-Management.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Lesson notes of climatology university.
O7-L3 Supply Chain Operations - ICLT Program
Basic Mud Logging Guide for educational purpose
Renaissance Architecture: A Journey from Faith to Humanism

PHP

  • 1. Prepared by: Chandan Das B.Tech 5th Semester Dept of CSE CIT , KOKRAJHAR
  • 2. INTRODUCTION • It is an interpreted, server-side scripting language. • Originally designed for web development. • Similar languages are Perl, ASP.NET, Ruby, JSP (Java Server Pages) • Embedded into HTML • Can use DB (MySQL, Oracle, Microsoft SQL, Postgre SQL)
  • 3. PHP stands for?? Personal Home Page
  • 5. HISTORY • Began in 1994 by Rasmus Lerdorf • Soon he named PHP/FI to build simple, dynamic web applications. • In 1995 -the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0". • In 1997 Zeev Suraski and Andi Gutmans rewrote the parser and formed the base of PHP 3, changing the name PHP: Hypertext Preprocessor. • On May,2000, PHP 4 was released, • On July , 2004, PHP 5 was released, powered by the new Zend Engine II. • In 2008 PHP 5 became the only stable version under development. • Finally after a vote the current version released in 2014 .
  • 7. SCRIPTING LANGUAGE • A scripting language is: – cross-platform since interpreter is easy to port – implicit variable declaration – compiled on demand – Extending – Glue programming
  • 17. BASIC PHP SYNTAX <?php ?>
  • 18. VARIABLES IN PHP • All variables in PHP start with a $ sign symbol. • Variables may contain strings, numbers, or arrays. <html> <body> <?php $txt="Hello World"; echo $txt; ?> </body> </html>
  • 19. DATA TYPES • String $name=“x” – 'My name is x.' – "My name is $name." • Boolean • Integer • Floating point • Array – $a=array("tokyo", "hanoi", "london") – $a=array("japan" => "tokyo", "vietnam" => "hanoi", "england" => "london") – $a[2] – $a["vietnam"]
  • 20. STRING HANDLING • String literals (constants) enclosed in double quotes “ ” or single quotes ‘ ’ • Within “”, variables are replaced by their value: – called variable interpolation. “My name is $name, I think” • Strings are concatenated (joined end to end) with the dot operator “key”.”board” == “keyboard”
  • 21. THE IF...ELSE STATEMENT Syntax if (condition) code to be executed if condition is true; else code to be executed if condition is false;
  • 22. Syntax switch (expression) { case label1: code to be executed if expression = label1; break; case label2: code to be executed if expression = label2; break; default: code to be executed if expression is different from both label1 and label2; } THE SWITCH STATEMENT
  • 23. PHP FUNCTION • Strlen(); • Strcmp(); • Date(); • Time(); • Include(); • Require();
  • 24. STATE MANAGEMENT • It is used to help web applications to maintain their state across several HTTP requests when needed. • Cookies • Session
  • 25. SESSION • Better option of cookie • Store information about a user. They are available only for a particular application and hold information of only one single user.
  • 27. <?php start_session(); $_SESSION[‘user_name’]=‘’ $_SESSION[‘pwd’]=‘’ ?> //create a session
  • 29. select username,password From table Where username=‘textbox1’ and password=‘textbox2’
  • 31. <?php start_session(); $_SESSION[‘user_name’]= $_SESSION[‘pwd’]= if(isset($_SESSION[‘username’])) Echo “Welcome”. $_SESSION[‘name’] ?> //retrieve a session
  • 32. • session_destroy(); • unset(); <?php start_session(); $_SESSION[‘user_name’]= if(isset($_POST[“lgt_btn"])) unset($_SESSION[‘user_name’]); ?> Name of the Logout button
  • 34. FEATURES OF PHP – Support for MySQL, Oracle, dbm, DB2, PostgreSQL – Can connect to any database which provides an ODBC driver (Open Database Connectivity Standard) – e.g. MS Access. – Supported on Windows, Mac OS X, other Unix-like systems (e.g. Linux). – Similar syntax and features as C++ and Java. – PHP designer,Wampp/Xampp are free of cost.
  • 35. REFERENCES • Wikipedia • Google images • www.w3schools.com