This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+----+-------------------+---------------+---------------+----------+---------------------+----------------+------------------------+-----------------------+---------------------+---------------------+--------+ | |
| id | nama | jenis_kelamin | tanggal_lahir | id_agama | email | telpon | alamat | id_status_kepegawaian | date_created | date_update | delete | | |
+----+-------------------+---------------+---------------+----------+---------------------+----------------+------------------------+-----------------------+---------------------+---------------------+--------+ | |
| 1 | Wahid Ashari | Laki-laki | 1990-04-03 | 1 | [email protected] | +6287812340909 | Jalan Pegangsaan Timur | 2 | 2017-02-06 15:58:02 | 2017-02-06 15:58:02 | 0 | | |
| 2 | Martin Natalegawa | Laki-laki | 1979-12-28 | 2 | [email protected] | +6289655556543 | Jalan Lingkar Luar | 3 | 2017-02-06 15:58:02 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------------+------------------------+------------+ | |
| nama | alamat | nama_agama | | |
+-------------------+------------------------+------------+ | |
| Wahid Ashari | Jalan Pegangsaan Timur | Islam | | |
| Martin Natalegawa | Jalan Lingkar Luar | Kristen | | |
| Afika Notonegoro | Jalan Godean | NULL | | |
| Dahlan Iskandar | Jalan Tulip Semerbak | Budha | | |
| Afifah | Jalan Mawar Merah | Islam | | |
+-------------------+------------------------+------------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$belajar = function() { | |
echo "Nama saya Muhamad Ilham Arrouf"; | |
}; | |
$belajar(); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = 2; | |
$b = 16; | |
// Cara 1 | |
function cara1() { | |
global $a, $b; | |
$c = $a + $b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Contoh 1 | |
function perkalian ($x, $y, $z) | |
{ | |
$hasil = $x * $y * $z; | |
return $hasil; | |
} | |
echo perkalian(2, 2, 7); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function tampilkan($text, $angka) | |
{ | |
$saya = "Saya " . $text . " " . $angka; | |
echo $saya; | |
} | |
function jarak() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Penulisan fungsi | |
function namadepan() | |
{ | |
echo "Muhamad"; | |
} | |
function namatengah() | |
{ | |
echo "Ilham"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function NamaFungsi() // NamaFungsi merupakan nama fungsi yang anda tentukan sendiri | |
{ | |
kode yang akan di eksekusi; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = saya; | |
switch ($a) { | |
case kamu : | |
echo "Angka Nol"; | |
break; | |
case dia : | |
echo "Angka Satu"; | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch ($var) { | |
case value1: | |
statement1; | |
break; | |
case value2: | |
statement2; | |
break; | |
case value3: | |
statement3; | |
break; |