Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

STRUCTURAL CONTROL STATEMENT  If  If…..else….  If ….elseif…else.

Presentasi serupa


Presentasi berjudul: "STRUCTURAL CONTROL STATEMENT  If  If…..else….  If ….elseif…else."— Transcript presentasi:

1 STRUCTURAL CONTROL STATEMENT  If  If…..else….  If ….elseif…else

2  A PHP script is a set of statements  Statements can be assignments / assignment, function calls, loops, conditions even an empty statement.  In general, statements end with a semicolon (;)

3  Used to execute a block of statements if it meets certain conditions  The syntax is:  If the condition is true (true), the statement block will be done. if (condition) statement block

4 statement if =60) { $Keterangan = "Lulus";} printf("Nilai = %d ", $Nilai); printf("Keterangan = %s ",$Keterangan); ?>

5 Statement if

6 statement IF Nilai Siswa : = 60) { $Keterangan = "Lulus"; } else { $Keterangan = "Tidak Lulus"; } print ("Nilai Ujian = $Nilai "); print ("Keterangan = $Keterangan"); } ?>

7  Principally similar to the statement of if  If... else... used for two branching.  If a condition is met, then do a block of statement 1, if not met, do block of statements 2.  syntax if (kondisi) { blok pernyataan 1; } Else { blok pernyataan 2; } if (kondisi): blok pernyataan1; Else: blok pernyataan2; Endif; atau

8 Statement IF Nilai Siswa: =90) $Indeks = "A"; elseif ($Nilai >=80) $Indeks = "B"; elseif ($Nilai >=70) $Indeks = "C"; elseif ($Nilai >=60) $Indeks = "D"; else $Indeks = "E"; if ($Nilai >=60) $Keterangan = "Lulus"; else $Keterangan = "Tidak Lulus"; print ("Nilai Ujian = $Nilai "); print ("Keterangan = $Keterangan "); print ("Indeks =$Indeks"); } ?>

9 The first meeting is finished, you can download these materials at download the menu, the course material ( filename = PHPMySQL3,Kamboja.) thank you see you at the next meeting


Download ppt "STRUCTURAL CONTROL STATEMENT  If  If…..else….  If ….elseif…else."

Presentasi serupa


Iklan oleh Google