SlideShare ist ein Scribd-Unternehmen logo
1 von 25
A PRESENTATION ON
PHP
Project Scope
The supplementary specification applies to online shopping system. This specification defines
the non-functional requirement of the system such as:
Functionality:
Since it stand alone application, one or more user may use it at a time.
Usability:
Desktop interface
Windows 98/2000/XP/7
Reliability:
The system is available during online time only .
Performance:
The performance depends on hardware specification
Objectives
The purpose of this document is to define the requirements of Online shopping system. This
supplementary specification lists the requirements that are not readily captured in the use case
model. Supplementary specification and the use case model capture a complete set of
requirement of the system.
Front End -Notepad++
Back End -Mysql
&
Myphpadmin
Brief History of PHP
PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially
developed for HTTP usage logging and server-side form generation in Unix.
PHP 2 (1995) transformed the language into a Server-side embedded scripting
language. Added database support, file uploads, variables, arrays, recursive functions,
conditionals, iteration, regular expressions, etc.
PHP 3 (1998) added support for ODBC data sources, multiple platform support, email
protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans .
PHP 4 (2000) became an independent component of the web server for added
efficiency. The parser was renamed the Zend Engine. Many security features were
added.
PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML
support using the libxml2 library, SOAP extension for interoperability with Web Services,
SQLite has been bundled with PHP
What is PHP Used For?
 PHP is a general-purpose server-side scripting language originally
designed for web development to produce dynamic web pages
 PHP can interact with MySQL databases
What is PHP?
 PHP == ‘Hypertext Preprocessor’
 Open-source, server-side scripting language
 Used to generate dynamic web-pages
 PHP scripts reside between reserved PHP tags
 This allows the programmer to embed PHP scripts within HTML
pages
What is PHP (cont’d)
 Interpreted language, scripts are parsed at run-
time rather than compiled beforehand
 Executed on the server-side
 Source-code not visible by client
 ‘View Source’ in browsers does not display the PHP
code
 Various built-in functions allow for fast
development
 Compatible with many popular databases
What does PHP code look like?
 Structurally similar to C/C++
 Supports procedural and object-oriented
paradigm (to some degree)
 All PHP statements end with a semi-colon
 Each PHP script must be enclosed in the
reserved PHP tag
<?php
…
?>
Comments in PHP
 Standard C, C++, and shell comment symbols
// C++ and Java-style comment
# Shell-style comments
/* C-style comments
These can span multiple lines */
Variables in PHP
 PHP variables must begin with a “$” sign
 Case-sensitive ($Foo != $foo != $fOo)
 Global and locally-scoped variables
 Global variables can be used anywhere
 Local variables restricted to a function or class
 Certain variable names reserved by PHP
 Form variables ($_POST, $_GET)
 Server variables ($_SERVER)
 Etc.
Variable usage
<?php
$foo = 25; // Numerical variable
$bar = “Hello”; // String variable
$foo = ($foo * 7); // Multiplies foo by 7
$bar = ($bar * 7); // Invalid expression
?>
Arithmetic Operations
 $a - $b // subtraction
 $a * $b // multiplication
 $a / $b // division
 $a += 5 // $a = $a+5 Also works for *= and /=
<?php
$a=15;
$b=30;
$total=$a+$b;
Print $total;
Print “<p><h1>$total</h1>”;
// total is 45
?>
Concatenation
 Use a period to join strings into one.
<?php
$string1=“Hello”;
$string2=“PHP”;
$string3=$string1 . “ ” . $string2;
Print $string3;
?>
Hello PHP
PHP Control Structures
 Control Structures: Are the structures within a language that
allow us to control the flow of execution through a program or
script.
 Grouped into conditional (branching) structures (e.g. if/else) and
repetition structures (e.g. while loops).
 Example if/else if/else statement:
if ($foo == 0) {
echo ‘The variable foo is equal to 0’;
}
else if (($foo > 0) && ($foo <= 5)) {
echo ‘The variable foo is between 1 and 5’;
}
else {
echo ‘The variable foo is equal to ‘.$foo;
}
If ... Else...
 If (condition)
{
Statements;
}
Else
{
Statement;
}
<?php
If($user==“John”)
{
Print “Hello John.”;
}
Else
{
Print “You are not John.”;
}
?>
No THEN in PHP
While Loops
 While (condition)
{
Statements;
}
<?php
$count=0;
While($count<3)
{
Print “hello PHP. ”;
$count += 1;
// $count = $count + 1;
// or
// $count++;
?>
hello PHP. hello PHP. hello PHP.
Date Display
$datedisplay=date(“yyyy/m/d”);
Print $datedisplay;
# If the date is April 1st, 2009
# It would display as 2009/4/1
2009/4/1
$datedisplay=date(“l, F m, Y”);
Print $datedisplay;
# If the date is April 1st, 2009
# Wednesday, April 1, 2009
Wednesday, April 1, 2009
Month, Day & Date Format Symbols
M Jan
F January
m 01
n 1
Day of Month d 01
Day of Month J 1
Day of Week l Monday
Day of Week D Mon
DATABASE
Index Page
Signin
Signup
Post An Add
Register
PHP

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

PHP Basic & Variables
PHP Basic & VariablesPHP Basic & Variables
PHP Basic & Variables
 
Php
PhpPhp
Php
 
Php array
Php arrayPhp array
Php array
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Templates
TemplatesTemplates
Templates
 
Dom
Dom Dom
Dom
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
HTML & CSS Masterclass
HTML & CSS MasterclassHTML & CSS Masterclass
HTML & CSS Masterclass
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
 
PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 

Andere mochten auch

Andere mochten auch (18)

Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component Presentation
 
Threads in PHP - Presentation
Threads in PHP - Presentation Threads in PHP - Presentation
Threads in PHP - Presentation
 
Php
PhpPhp
Php
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
 
Php oop presentation
Php   oop presentationPhp   oop presentation
Php oop presentation
 
PHP presentation - Com 585
PHP presentation - Com 585PHP presentation - Com 585
PHP presentation - Com 585
 
Devise | Presentation for Alpharetta PHP / Laravel Group
Devise | Presentation for Alpharetta PHP / Laravel GroupDevise | Presentation for Alpharetta PHP / Laravel Group
Devise | Presentation for Alpharetta PHP / Laravel Group
 
PHP presentation
PHP presentationPHP presentation
PHP presentation
 
Internationalisation with PHP and Intl
Internationalisation with PHP and IntlInternationalisation with PHP and Intl
Internationalisation with PHP and Intl
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Php string function
Php string function Php string function
Php string function
 
PHP Tour 2016 Phinx Presentation
PHP Tour 2016 Phinx PresentationPHP Tour 2016 Phinx Presentation
PHP Tour 2016 Phinx Presentation
 
Php string
Php stringPhp string
Php string
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Html JavaScript and CSS
Html JavaScript and CSSHtml JavaScript and CSS
Html JavaScript and CSS
 
Principles of Teaching 1: Objective-Related Principles of Teaching
Principles of Teaching 1: Objective-Related Principles of TeachingPrinciples of Teaching 1: Objective-Related Principles of Teaching
Principles of Teaching 1: Objective-Related Principles of Teaching
 

Ähnlich wie PHP

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
burasyacob012
 

Ähnlich wie PHP (20)

Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
PHP
PHPPHP
PHP
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Php notes
Php notesPhp notes
Php notes
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Prersentation
PrersentationPrersentation
Prersentation
 
Php
PhpPhp
Php
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Php ppt
Php pptPhp ppt
Php ppt
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 
Php ppt
Php pptPhp ppt
Php ppt
 
php basics
php basicsphp basics
php basics
 
Lecture8
Lecture8Lecture8
Lecture8
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
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
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 

Mehr von Jawhar Ali

Mehr von Jawhar Ali (20)

seminar report on What is ransomware
seminar report on What is ransomwareseminar report on What is ransomware
seminar report on What is ransomware
 
seminar report on Sql injection
seminar report on Sql injectionseminar report on Sql injection
seminar report on Sql injection
 
seminar report on kingapp application
seminar report on kingapp applicationseminar report on kingapp application
seminar report on kingapp application
 
seminar report on school management system
seminar report on school management systemseminar report on school management system
seminar report on school management system
 
seminar presentation on apache-spark
seminar presentation on apache-sparkseminar presentation on apache-spark
seminar presentation on apache-spark
 
seminar presentation on Face ricognition technology
seminar presentation on Face ricognition technologyseminar presentation on Face ricognition technology
seminar presentation on Face ricognition technology
 
seminar presentation on Digital Jwellery
seminar presentation on Digital Jwelleryseminar presentation on Digital Jwellery
seminar presentation on Digital Jwellery
 
powerpoint presentation on sixth sense Technology
powerpoint presentation  on sixth sense Technologypowerpoint presentation  on sixth sense Technology
powerpoint presentation on sixth sense Technology
 
Powerpoint presentation on 5G wireless technology
Powerpoint presentation on 5G wireless technologyPowerpoint presentation on 5G wireless technology
Powerpoint presentation on 5G wireless technology
 
powerpoint presentation on Google glass
powerpoint presentation on Google glasspowerpoint presentation on Google glass
powerpoint presentation on Google glass
 
Table Of Contents Google Glass
Table Of Contents Google GlassTable Of Contents Google Glass
Table Of Contents Google Glass
 
introduction and abstract on Google Glass Major report
introduction and abstract on  Google Glass Major reportintroduction and abstract on  Google Glass Major report
introduction and abstract on Google Glass Major report
 
Candidate declaration on Google Glass
Candidate declaration on Google GlassCandidate declaration on Google Glass
Candidate declaration on Google Glass
 
front Page on Google Glass
 front Page on Google Glass front Page on Google Glass
front Page on Google Glass
 
Table of contents on blood bank management system
Table of contents on blood bank management systemTable of contents on blood bank management system
Table of contents on blood bank management system
 
List of figures in Blood bank management system
List of figures in Blood bank management systemList of figures in Blood bank management system
List of figures in Blood bank management system
 
Full report on blood bank management system
Full report on  blood bank management systemFull report on  blood bank management system
Full report on blood bank management system
 
Cand declaration
Cand declaration Cand declaration
Cand declaration
 
Training report on web developing
Training report on web developingTraining report on web developing
Training report on web developing
 
seminar report on wireless Sensor network
seminar report on wireless Sensor networkseminar report on wireless Sensor network
seminar report on wireless Sensor network
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
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
QucHHunhnh
 
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
heathfieldcps1
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Kürzlich hochgeladen (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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
 
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
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

PHP

  • 2. Project Scope The supplementary specification applies to online shopping system. This specification defines the non-functional requirement of the system such as: Functionality: Since it stand alone application, one or more user may use it at a time. Usability: Desktop interface Windows 98/2000/XP/7 Reliability: The system is available during online time only . Performance: The performance depends on hardware specification Objectives The purpose of this document is to define the requirements of Online shopping system. This supplementary specification lists the requirements that are not readily captured in the use case model. Supplementary specification and the use case model capture a complete set of requirement of the system.
  • 3. Front End -Notepad++ Back End -Mysql & Myphpadmin
  • 4. Brief History of PHP PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially developed for HTTP usage logging and server-side form generation in Unix. PHP 2 (1995) transformed the language into a Server-side embedded scripting language. Added database support, file uploads, variables, arrays, recursive functions, conditionals, iteration, regular expressions, etc. PHP 3 (1998) added support for ODBC data sources, multiple platform support, email protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans . PHP 4 (2000) became an independent component of the web server for added efficiency. The parser was renamed the Zend Engine. Many security features were added. PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML support using the libxml2 library, SOAP extension for interoperability with Web Services, SQLite has been bundled with PHP
  • 5. What is PHP Used For?  PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages  PHP can interact with MySQL databases
  • 6. What is PHP?  PHP == ‘Hypertext Preprocessor’  Open-source, server-side scripting language  Used to generate dynamic web-pages  PHP scripts reside between reserved PHP tags  This allows the programmer to embed PHP scripts within HTML pages
  • 7. What is PHP (cont’d)  Interpreted language, scripts are parsed at run- time rather than compiled beforehand  Executed on the server-side  Source-code not visible by client  ‘View Source’ in browsers does not display the PHP code  Various built-in functions allow for fast development  Compatible with many popular databases
  • 8. What does PHP code look like?  Structurally similar to C/C++  Supports procedural and object-oriented paradigm (to some degree)  All PHP statements end with a semi-colon  Each PHP script must be enclosed in the reserved PHP tag <?php … ?>
  • 9. Comments in PHP  Standard C, C++, and shell comment symbols // C++ and Java-style comment # Shell-style comments /* C-style comments These can span multiple lines */
  • 10. Variables in PHP  PHP variables must begin with a “$” sign  Case-sensitive ($Foo != $foo != $fOo)  Global and locally-scoped variables  Global variables can be used anywhere  Local variables restricted to a function or class  Certain variable names reserved by PHP  Form variables ($_POST, $_GET)  Server variables ($_SERVER)  Etc.
  • 11. Variable usage <?php $foo = 25; // Numerical variable $bar = “Hello”; // String variable $foo = ($foo * 7); // Multiplies foo by 7 $bar = ($bar * 7); // Invalid expression ?>
  • 12. Arithmetic Operations  $a - $b // subtraction  $a * $b // multiplication  $a / $b // division  $a += 5 // $a = $a+5 Also works for *= and /= <?php $a=15; $b=30; $total=$a+$b; Print $total; Print “<p><h1>$total</h1>”; // total is 45 ?>
  • 13. Concatenation  Use a period to join strings into one. <?php $string1=“Hello”; $string2=“PHP”; $string3=$string1 . “ ” . $string2; Print $string3; ?> Hello PHP
  • 14. PHP Control Structures  Control Structures: Are the structures within a language that allow us to control the flow of execution through a program or script.  Grouped into conditional (branching) structures (e.g. if/else) and repetition structures (e.g. while loops).  Example if/else if/else statement: if ($foo == 0) { echo ‘The variable foo is equal to 0’; } else if (($foo > 0) && ($foo <= 5)) { echo ‘The variable foo is between 1 and 5’; } else { echo ‘The variable foo is equal to ‘.$foo; }
  • 15. If ... Else...  If (condition) { Statements; } Else { Statement; } <?php If($user==“John”) { Print “Hello John.”; } Else { Print “You are not John.”; } ?> No THEN in PHP
  • 16. While Loops  While (condition) { Statements; } <?php $count=0; While($count<3) { Print “hello PHP. ”; $count += 1; // $count = $count + 1; // or // $count++; ?> hello PHP. hello PHP. hello PHP.
  • 17. Date Display $datedisplay=date(“yyyy/m/d”); Print $datedisplay; # If the date is April 1st, 2009 # It would display as 2009/4/1 2009/4/1 $datedisplay=date(“l, F m, Y”); Print $datedisplay; # If the date is April 1st, 2009 # Wednesday, April 1, 2009 Wednesday, April 1, 2009
  • 18. Month, Day & Date Format Symbols M Jan F January m 01 n 1 Day of Month d 01 Day of Month J 1 Day of Week l Monday Day of Week D Mon