Skip to content

Commit b33409c

Browse files
committed
finish php basic
0 parents  commit b33409c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+14328
-0
lines changed

Diff for: condition.php

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
$tanya=readline("Pilih mana (yes/no/maybe) ?");
4+
5+
if($tanya=="yes") // jika memilih yes
6+
{
7+
echo "Kamu memilih Yes";
8+
}elseif($tanya=="no") // jika memilih no
9+
{
10+
echo "Kamu memilih No";
11+
}
12+
elseif($tanya=="maybe") // jika memilih maybe
13+
{
14+
echo "Kamu memilih maybe";
15+
}
16+
else // Jika tidak memilih yes/no/maybe ( tidak dalam pilihan yang tersedia )
17+
{
18+
echo "Kamu tidak memilih pilihan yang tersedia !!!!";
19+
}
20+
21+
echo PHP_EOL;
22+
23+
$menu=readline("Pilih angka 1-3 ? ");
24+
25+
// Pilih input yang akan diuji
26+
switch($menu)
27+
{
28+
case 1: // Jika user menginput angka 1
29+
echo "Anda memilih angka 1";
30+
break;
31+
case 2: // Jika user menginput angka 2
32+
echo "Anda memilih angka 2";
33+
break;
34+
case 3: // Jika user menginput angka 3
35+
echo "Anda memilih angka 3";
36+
break;
37+
default: // jika user tidak menginput angka yang tersedia
38+
echo "Anda tidak memilih pilihan yang tersedia";
39+
}

Diff for: exercise.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
date_default_timezone_set('Asia/Jakarta');
3+
var_dump(date('d/F/Y H:i:s'));

Diff for: hello.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* First Code Hello World
5+
*
6+
* @author Arif Iskandar [email protected]
7+
* @copyright 2020
8+
*
9+
*/
10+
11+
echo 'Hello World!';
12+
13+
echo PHP_INT_MIN;
14+
echo PHP_EOL.PHP_INT_MAX;
15+
echo PHP_EOL;
16+
echo PHP_VERSION;

0 commit comments

Comments
 (0)