Syntax : If ( Expression ) If ( Expression ) {Statements; } Example : <?php <?php $a=5; $a=5; If ( $a == 1) If ( $a == 1) { echo “It is 1:” } ?> ?>

Slides:



Advertisements
Similar presentations
Selection Feature of C: Decision making statements: It allow us to take decisions as to which code is to be executed next. Since these statements control.
Advertisements

Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Do-while Loops Programming. COMP102 Prog Fundamentals I: do-while Loops /Slide 2 The do-while Statement l Syntax do action while (condition) l How it.
The "if structure" is used to execute statement(s) only if the given condition is satisfied.
CSC 142 G 1 CSC 142 Conditionals [Reading: chapter 5]
Pascal Programming Today Chapter 4 1 »Conditional statements allow the execution of one of a number of possible operations. »Conditional statements include:
Creating PHP Pages Chapter 7 PHP Decisions Making.
1 PHP Statement Constructs Server Scripting. 5-2 Basic Statement All Statements end in a semicolon. Statements are delimited from the HTML code by enclosing.
PHP Functions and Control Structures. 2 Defining Functions Functions are groups of statements that you can execute as a single unit Function definitions.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Презентація за розділом “Гумористичні твори”
Центр атестації педагогічних працівників 2014
Галактики і квазари.
Характеристика ІНДІЇ.
Процюк Н.В. вчитель початкових класів Боярської ЗОШ І – ІІІ ст №4
IDK0040 Võrgurakendused I harjutus 07: PHP: Operators, Switch, Forms Deniss Kumlander.
The foreach LooptMyn1 The foreach Loop The foreach loop gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error.
Decisions, Loops, and Arrays Achmad Arwan, S.Kom.
1. We’ve learned that our programs are read by the compiler in order, from top to bottom, just as they are written The order of statement execution is.
Simple Control Structures IF, IF-ELSE statements in C.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
PHP Programming with MySQL Slide 4-1 CHAPTER 4 Functions and Control Structures.
Array & Foreach อาร์เรย์และคำสั่งวนลูป. Content 1. Definition and Usage 2. Syntax 3. print_r() Statement 4. For and Foreach 5. Array Functions.
Chapter 2 Functions and Control Structures PHP Programming with MySQL 2 nd Edition.
Control Structures By Shyam Gurram. Control Structure In this chapter we have two different types of structures. Conditional Structure Iterative Control.
PHP Constructs Advance Database Management Systems Lab no.3.
If…else statements. Boolean Expressions Boolean expression - An expression whose value is either true or false true = 1 false = 0 Datatype: boolean.
PHP - 1h. How it works Client requests document Server loads document in memory Server processes document with relevant module (PHP) Server sends XHTML.
Духовні символи Голосіївського району
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
The If Statement There are no switch statements in Python. You need to use just if statements. There are no switch statements in Python. You need to use.
Introduction to PHP 1.What is PHP? What Is PHP?  php: hypertext preprocessor  Server-side scripting language—like ASP—scripts are executed on server.
Conditional statements and boolean expressions Arithmetic, relational and logical operators.
USING CONDITIONAL CODE AMIR KHANZADA. Conditional Statement  Conditional statements are the set of commands used to perform different actions based on.
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
PHP Condtions and Loops Prepared by Dr. Maher Abuhamdeh.
Sequence, Selection, Iteration The IF Statement
C-Language Lecture By B.S.S.Tejesh, S.Neeraja
Struktur Control : Decision
Loop Control Structure.
Selection CSCE 121 J. Michael Moore.
Проф. д-р Васил Цанов, Институт за икономически изследвания при БАН
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
О Б Щ И Н А С И Л И С Т Р А П р о е к т Б ю д ж е т г.
Електронни услуги на НАП
Боряна Георгиева – директор на
РАЙОНЕН СЪД - БУРГАС РАБОТНА СРЕЩА СЪС СЪДЕБНИТЕ ЗАСЕДАТЕЛИ ПРИ РАЙОНЕН СЪД – БУРГАС 21 ОКТОМВРИ 2016 г.
Сътрудничество между полицията и другите специалисти в България
Съобщение Ръководството на НУ “Христо Ботев“ – гр. Елин Пелин
НАЦИОНАЛНА АГЕНЦИЯ ЗА ПРИХОДИТЕ
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Съвременни софтуерни решения
ПО ПЧЕЛАРСТВО ЗА ТРИГОДИШНИЯ
от проучване на общественото мнение,
Васил Големански Ноември, 2006
Програма за развитие на селските райони
ОПЕРАТИВНА ПРОГРАМА “АДМИНИСТРАТИВЕН КАПАЦИТЕТ”
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
МЕДИЦИНСКИ УНИВЕРСИТЕТ – ПЛЕВЕН
Стратегия за развитие на клъстера 2015
Моето наследствено призвание
Правна кантора “Джингов, Гугински, Кючуков & Величков”
Безопасност на движението
Conditional Statements
Find the reference angle for the angle measuring {image}
There many situations comes in real life when we need to make some decisions and based on these decisions, we decide what should we do next. Similar situations.
PHP CONDITIONAL STATEMENTS
Presentation transcript:

Syntax : If ( Expression ) If ( Expression ) {Statements; } Example : <?php <?php $a=5; $a=5; If ( $a == 1) If ( $a == 1) { echo “It is 1:” } ?> ?>

Syntax : if ( Expression ) if ( Expression ) { Expression When Condition True ; } else else { Statement When Condition False ; }

Syntax : foreach ($Array name as $Array Item ) foreach ($Array name as $Array Item ){ Executes the content of these Braces ; } Executes the content of these Braces ; }

Example : <?php $array=array(1,2,3,4,5); $array=array(1,2,3,4,5); foreach ( $array as $data ) foreach ( $array as $data ){ echo $data; }?>

Example : Example :<html><body> <?php $India=array(“GUJARAT”, “GOA”,”PUNJAB”); Foreach($India as $State => $State_index) { echo “ $State_index- $State”; } ?></font></center>