SlideShare a Scribd company logo
1 of 12
 PHP Operators
› Arithmetic operators
› Assignment operators
› Comparison operators
› Increment/Decrement operators
 PHP Conditional Statements
› if statement
› if...else statement
› if...elseif....else statement
› switch statement
 Logical operators
 String operators
 Array operators
 Loop Functions
› For Loop
› While Loop
› Do While
 Functions
 Arrays
 Manipulate Arrays
 Variable Scope
 The while loop executes a particular set
of codes till the condition is true
 Syntax :
while (condition is true)
{
    code to be executed;
}
 The do-while loop execute the block of
code once, and then checks the
condition and repeats the loop, while
the specified condition is true.
 Syntax :
do
{
code to be executed;
} while (condition is true);
 It is used when we already know the
number of times we want to run that
loop.
 Syntax :
for (init counter; test counter; increment counter)
{
code to be executed;
}
 While loop checks for the condition first.
so it may not even enter into the loop, if
the condition is false.
 do while loop, execute the statements in
the loop first before checks for the
condition. At least one iteration takes
places, even if the condition is false.
 for loop is similar to while loop except
that initialization statement, usually the
counter variable initialization
 The main power of PHP is in its Functions,
user defined functions or system
functions
 PHP has many inbuilt functions.
 User can also define functions
 A function is a set of statements that can
be used repeatedly in a program
 Function will be executed by the call to
the function
 A user defined function should start with
a “function” tag
 Syntax :
function functionName() {
    code to be executed;
}
 A function name can start with a letter or
underscore but not a number.
 Function names are NOT case-sensitive.
 Some functions require inputs to work
properly, eg. Area, conversions, etc.
 Arguments are specified after the
function name, inside the parentheses
 An Argument behaves as a variable
here, it is used to pass the value
 If a default value needs to be set, we will
specify it in the arguments to the
function
 Declaration :
<?php
function functionname (arguments = value) {
echo "The value is : $minlimit <br>";
}
 To make a function return a value, use
the return statement
 Declaration :
<?php
function sum($x, $y) {
$z = $x + $y;
return $z;
}

More Related Content

What's hot (20)

Understand Decision structures in c++ (cplusplus)
Understand Decision structures in c++ (cplusplus)Understand Decision structures in c++ (cplusplus)
Understand Decision structures in c++ (cplusplus)
 
Loop c++
Loop c++Loop c++
Loop c++
 
Loops c++
Loops c++Loops c++
Loops c++
 
C++ loop
C++ loop C++ loop
C++ loop
 
Looping statements
Looping statementsLooping statements
Looping statements
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
 
Looping
LoopingLooping
Looping
 
Linq & lambda overview C#.net
Linq & lambda overview C#.netLinq & lambda overview C#.net
Linq & lambda overview C#.net
 
Immutability and pure functions
Immutability and pure functionsImmutability and pure functions
Immutability and pure functions
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
 
OPERATING OVERLOADING IN VHDL
OPERATING OVERLOADING IN VHDLOPERATING OVERLOADING IN VHDL
OPERATING OVERLOADING IN VHDL
 
Kelompok 8 Pbw
Kelompok 8 PbwKelompok 8 Pbw
Kelompok 8 Pbw
 
Kelompok 8 Pbw
Kelompok 8 PbwKelompok 8 Pbw
Kelompok 8 Pbw
 
Functions in php
Functions in phpFunctions in php
Functions in php
 
Cold fusion best practice
Cold fusion best practiceCold fusion best practice
Cold fusion best practice
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
While loop
While loopWhile loop
While loop
 
Returning Data
Returning DataReturning Data
Returning Data
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Loop control in c++
Loop control in c++Loop control in c++
Loop control in c++
 

Viewers also liked

Company Profile v3
Company Profile v3Company Profile v3
Company Profile v3Omni Integra
 
Introduction to php 4
Introduction to php   4Introduction to php   4
Introduction to php 4pctechnology
 
Introduction to php 6
Introduction to php   6Introduction to php   6
Introduction to php 6pctechnology
 
Методы и алгоритмы обследования в аллергологии
Методы и алгоритмы обследования в аллергологииМетоды и алгоритмы обследования в аллергологии
Методы и алгоритмы обследования в аллергологииParacels_Tyumen
 
Introduction to php 2
Introduction to php   2Introduction to php   2
Introduction to php 2pctechnology
 
Introduction to php 3
Introduction to php   3Introduction to php   3
Introduction to php 3pctechnology
 
Introduction to PHP - Slide 1
Introduction to PHP - Slide 1 Introduction to PHP - Slide 1
Introduction to PHP - Slide 1 pctechnology
 
Asmaa CV updated online 5_8_2015
Asmaa CV  updated online 5_8_2015Asmaa CV  updated online 5_8_2015
Asmaa CV updated online 5_8_2015Asmaa Al Maghraby
 

Viewers also liked (14)

Company Profile v3
Company Profile v3Company Profile v3
Company Profile v3
 
Vlase Nicoleta
Vlase NicoletaVlase Nicoleta
Vlase Nicoleta
 
Mesa Bath & Kitchen
Mesa Bath & KitchenMesa Bath & Kitchen
Mesa Bath & Kitchen
 
Forex.ppt
Forex.pptForex.ppt
Forex.ppt
 
Resume_vikas
Resume_vikasResume_vikas
Resume_vikas
 
Introduction to php 4
Introduction to php   4Introduction to php   4
Introduction to php 4
 
Introduction to php 6
Introduction to php   6Introduction to php   6
Introduction to php 6
 
PHUMLANI C.V
PHUMLANI C.VPHUMLANI C.V
PHUMLANI C.V
 
Методы и алгоритмы обследования в аллергологии
Методы и алгоритмы обследования в аллергологииМетоды и алгоритмы обследования в аллергологии
Методы и алгоритмы обследования в аллергологии
 
АСТМА-школа
АСТМА-школаАСТМА-школа
АСТМА-школа
 
Introduction to php 2
Introduction to php   2Introduction to php   2
Introduction to php 2
 
Introduction to php 3
Introduction to php   3Introduction to php   3
Introduction to php 3
 
Introduction to PHP - Slide 1
Introduction to PHP - Slide 1 Introduction to PHP - Slide 1
Introduction to PHP - Slide 1
 
Asmaa CV updated online 5_8_2015
Asmaa CV  updated online 5_8_2015Asmaa CV  updated online 5_8_2015
Asmaa CV updated online 5_8_2015
 

Similar to Introduction to php 5

04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptxManas40552
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdfvenud11
 
Php intro by sami kz
Php intro by sami kzPhp intro by sami kz
Php intro by sami kzsami2244
 
PHP MATERIAL
PHP MATERIALPHP MATERIAL
PHP MATERIALzatax
 
Python Function.pdf
Python Function.pdfPython Function.pdf
Python Function.pdfNehaSpillai1
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 FunctionDeepak Singh
 
Functions in PHP.pptx
Functions in PHP.pptxFunctions in PHP.pptx
Functions in PHP.pptxJapneet9
 
php user defined functions
php user defined functionsphp user defined functions
php user defined functionsvishnupriyapm4
 
Dynamic website
Dynamic websiteDynamic website
Dynamic websitesalissal
 
INTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONS
INTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONSINTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONS
INTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONSKalaivaniD12
 
Arrays &amp; functions in php
Arrays &amp; functions in phpArrays &amp; functions in php
Arrays &amp; functions in phpAshish Chamoli
 
Introduction to Functional Programming (w/ JS)
Introduction to Functional Programming (w/ JS)Introduction to Functional Programming (w/ JS)
Introduction to Functional Programming (w/ JS)Allan Marques Baptista
 
WORKING WITH FUNCTIONS
WORKING WITH FUNCTIONSWORKING WITH FUNCTIONS
WORKING WITH FUNCTIONSPihuJha1
 
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...DrupalMumbai
 

Similar to Introduction to php 5 (20)

04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdf
 
Php intro by sami kz
Php intro by sami kzPhp intro by sami kz
Php intro by sami kz
 
PHP MATERIAL
PHP MATERIALPHP MATERIAL
PHP MATERIAL
 
85ec7 session2 c++
85ec7 session2 c++85ec7 session2 c++
85ec7 session2 c++
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Python Function.pdf
Python Function.pdfPython Function.pdf
Python Function.pdf
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 Function
 
Functions in PHP.pptx
Functions in PHP.pptxFunctions in PHP.pptx
Functions in PHP.pptx
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 
php user defined functions
php user defined functionsphp user defined functions
php user defined functions
 
Dynamic website
Dynamic websiteDynamic website
Dynamic website
 
php basics
php basicsphp basics
php basics
 
INTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONS
INTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONSINTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONS
INTRODUCTION TO PYTHON PROGRMMING AND FUNCTIONS
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Arrays &amp; functions in php
Arrays &amp; functions in phpArrays &amp; functions in php
Arrays &amp; functions in php
 
Introduction to Functional Programming (w/ JS)
Introduction to Functional Programming (w/ JS)Introduction to Functional Programming (w/ JS)
Introduction to Functional Programming (w/ JS)
 
WORKING WITH FUNCTIONS
WORKING WITH FUNCTIONSWORKING WITH FUNCTIONS
WORKING WITH FUNCTIONS
 
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
 

Recently uploaded

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Recently uploaded (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

Introduction to php 5

  • 1.
  • 2.  PHP Operators › Arithmetic operators › Assignment operators › Comparison operators › Increment/Decrement operators  PHP Conditional Statements › if statement › if...else statement › if...elseif....else statement › switch statement  Logical operators  String operators  Array operators
  • 3.  Loop Functions › For Loop › While Loop › Do While  Functions  Arrays  Manipulate Arrays  Variable Scope
  • 4.  The while loop executes a particular set of codes till the condition is true  Syntax : while (condition is true) {     code to be executed; }
  • 5.  The do-while loop execute the block of code once, and then checks the condition and repeats the loop, while the specified condition is true.  Syntax : do { code to be executed; } while (condition is true);
  • 6.  It is used when we already know the number of times we want to run that loop.  Syntax : for (init counter; test counter; increment counter) { code to be executed; }
  • 7.  While loop checks for the condition first. so it may not even enter into the loop, if the condition is false.  do while loop, execute the statements in the loop first before checks for the condition. At least one iteration takes places, even if the condition is false.  for loop is similar to while loop except that initialization statement, usually the counter variable initialization
  • 8.  The main power of PHP is in its Functions, user defined functions or system functions  PHP has many inbuilt functions.  User can also define functions  A function is a set of statements that can be used repeatedly in a program  Function will be executed by the call to the function
  • 9.  A user defined function should start with a “function” tag  Syntax : function functionName() {     code to be executed; }  A function name can start with a letter or underscore but not a number.  Function names are NOT case-sensitive.
  • 10.  Some functions require inputs to work properly, eg. Area, conversions, etc.  Arguments are specified after the function name, inside the parentheses  An Argument behaves as a variable here, it is used to pass the value
  • 11.  If a default value needs to be set, we will specify it in the arguments to the function  Declaration : <?php function functionname (arguments = value) { echo "The value is : $minlimit <br>"; }
  • 12.  To make a function return a value, use the return statement  Declaration : <?php function sum($x, $y) { $z = $x + $y; return $z; }