PHP Stringjet / Strukturat mbi Stringjet / Operatoret / Kushtet / Loops.

Slides:



Advertisements
Similar presentations
Java Control Statements
Advertisements

AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Switch code for Lab 4.2 switch (input) { /* input is a variable that we will test. */ case 'M': printf("The prefix is equal to 1E6.\n"); break; case 'k':
Basic Programming by Mo Zhang. Notepad Notepad++ Dreamweaver Eclipse, …
Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
Creating PHP Pages Chapter 7 PHP Decisions Making.
PHP Functions and Control Structures. 2 Defining Functions Functions are groups of statements that you can execute as a single unit Function definitions.
Chapter 4 Functions and Control Structures PHP Programming with MySQL.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, © Copyright 2010, All Rights Reserved 1.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Control Structures, Operators, and Functions.
Php. What is PHP? PHP is an acronym for "PHP Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on.
IDK0040 Võrgurakendused I harjutus 07: PHP: Operators, Switch, Forms Deniss Kumlander.
PHP Tutorial By RAY BALIKI && ROY GHORAYEB. DEFINITION PHP is a powerful server-side scripting language for creating dynamic and interactive websites.
PHP / MySQL. What is PHP? PHP is an acronym for "PHP Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed.
Decisions, Loops, and Arrays Achmad Arwan, S.Kom.
INTERNET APPLICATION DEVELOPMENT For More visit:
Unit 5 – “Watch Out!”. Introduction New Topics Case Structures New Functions Less? Comparison Function Ultrasonic Sensor.
Variables, Operators and Data Types. By Shyam Gurram.
CONTROL STRUCTURE The if, elseif, and else & switch Statements 1.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
MS3304: Week 6 Conditional statements. Overview The flow of control through a script Boolean Logic Conditional & logical operators Basic decision making.
PHP Programming with MySQL Slide 4-1 CHAPTER 4 Functions and Control Structures.
Slide 1 PHP Operators and Control Structures ITWA 133.
PHP. What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server.
Julian Springer Room 42 Joe Slovo.  W3 schools recommend that you have a basic understanding of HTML and of JavaScript before attempting to grasp PHP.
Chapter 2 Functions and Control Structures PHP Programming with MySQL 2 nd Edition.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Control Structures By Shyam Gurram. Control Structure In this chapter we have two different types of structures. Conditional Structure Iterative Control.
Chapter 3. Outline Relational Operators Loops Decisions Logical Operators Precedence Summary.
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.
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
CST336, Dr. Krzysztof Pietroszek Week 2: PHP. 1.Introduction to PHP 2.Embed PHP code into an HTML web page 3.Generate (output HTML) web page using PHP.
CSI 3125, Preliminaries, page 1 Control Statements.
Program Structures Chapter 5. 5 Branching Allows different code to execute based on a conditional test. if, if-else, and switch statements.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Chapter 6 Conditionals. Learning Java through Alice © Daly and Wrigley Objectives List relational operators. List logical operators. Use the hierarchy.
USING CONDITIONAL CODE AMIR KHANZADA. Conditional Statement  Conditional statements are the set of commands used to perform different actions based on.
JavaScript JavaScript ( Condition and Loops ). Conditional Statements If Statement If...else Statement if (condition) { code to be executed if condition.
Unit – 3 Control structures. Condition Statements 1.If.…..else :- Has someone ever told you, "if you work hard, then you will succeed"? And what happens.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
 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.
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 this.
>> Fundamental Concepts in PHP
Expressions and Control Flow in PHP
CHAPTER 4 DECISIONS & LOOPS
Chapter 9 Repetition.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Lecturer CS & IT Department UOS MBDIN
ITM 352 Flow-Control: Loops
Struktur Control : Decision
Chapter 5 Repetition.
IF if (condition) { Process… }
Chapter 9 Control Structures.
محاضرة 1: مقدمة للمسـاق و مراجعـة للأساسيـات
Programming with PHP Part 2
Embedded PHP in HTML 5 & Strings in PHP
Basics.
Computer Science Core Concepts
Decisions, Loops, and Arrays
Conditional statement & LOOPS
Control Structures.
PHP CONDITIONAL STATEMENTS
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Contact PSK Technologies Pvt. Ltd IT Company Address - Plot No-780, Near Durga Temple, Katol Road Chaoni, Nagpur-13.
Presentation transcript:

PHP Stringjet / Strukturat mbi Stringjet / Operatoret / Kushtet / Loops

Printimi  Ka dy menyra per te shfaqur permbajtjen ne PHP te cilat jane: 1. echo 2. print echo “Ky eshte shembull”; print “Ky eshte shembull”;

Funksionet mbi stringjet echo str_word_count("Hello world!"); // output 2 echo strlen("Hello world!"); // output 12 echo strrev("Hello world!"); // output !dlrow olleH echo strpos("Hello world!", "world"); // output 6 echo str_replace("world", "Dolly", "Hello world!"); // output Hello Dolly! echo strtolower("Hello world!"); // output hello world! echo strtoupper("Hello world!"); // output HELLO WORLD! echo substr_replace("Hello","world",0); //output world

Operatoret Matematik ne PHP OperatoriEmriShembull +Addition$x + $y -Subtraction$x - $y *Multiplication$x * $y /Division$x / $y %Modulus$x % $y **Exponentiation$x ** $y Operatoret e Vleredhenies VleredheniaNgjashem me… x = y x += yx = x + y x -= yx = x - y x *= yx = x * y x /= yx = x / y x %= yx = x % y

Operatoret Krahasues OperatoriEmrertimiShembull ==Equal$x == $y ===Identical$x === $y !=Not equal$x != $y <>Not equal$x <> $y !==Not identical$x !== $y >Greater than$x > $y <Less than$x < $y >=Greater than or equal to$x >= $y <=Less than or equal to$x <= $y OperatoriEmrertimi ++$xPre-increment $x++Post-increment --$xPre-decrement $x--Post-decrement

Operatoret Logjike OperatoriEmertimiShembull andAnd$x and $y orOr$x or $y xorXor$x xor $y &&And$x && $y ||Or$x || $y !Not!$x

Fjalite Kushtore  if  if...else  if...elseif....else  if (kushti) { kodi nqs eshte kushti me lart true; } elseif (kushti) { kodi nqs eshte kushti me lart true; } else { kodi nqs kushtet me lart jane false; }

Switch switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; case label3: code to be executed if n=label3; break;... default: code to be executed if n is different from all labels; }

PHP Loops  While while (condition is true) { code to be executed; }  Do While do { code to be executed; } while (condition is true);  PHP for Loop for (init counter; test counter; increment counter) { code to be executed; }