This file contains 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 | |
class Palindrome | |
{ | |
public static function isPalindrome($word) | |
{ | |
$wd = strtolower($word); | |
if ($wd == strrev($wd)){ | |
return true; | |
} | |
return false; |
This file contains 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 | |
class Pipeline | |
{ | |
public static function make_pipeline(...$funcs) | |
{ | |
return function($arg) use ($funcs) | |
{ | |
//Gunakan Foreach | |
foreach ($funcs as $func) | |
{ |
This file contains 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
-- Write only the SQL statement that solves the problem and nothing else. | |
SELECT COUNT(*) FROM students WHERE firstName = 'John' |
This file contains 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
-- Write only the SQL statement that solves the problem and nothing else. | |
SELECT name FROM employees | |
WHERE id NOT IN (SELECT managerId FROM employees WHERE managerId IS NOT NULL); |
This file contains 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 | |
// Fungsi Fibonacci | |
function Fibonacci($batas){ | |
echo "Hasil Deret : "; | |
$angkaPertama = 1; | |
$angkaKedua = 2; | |
//$nKe = 0; | |
while ($angkaPertama < $batas){ | |
$output = $angkaPertama; |
This file contains 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
<form action="<?php $_SERVER["PHP_SELF"]; ?>" method="post"> | |
<input type="text" name="user"> | |
<input type="submit" value="Kirim"> | |
</form> | |
<?php | |
// Variabel biasa | |
$nama = "Moch Diki Widianto"; | |
$angka_pertama = 4; |
This file contains 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 | |
$data = [ | |
[ | |
"nama" => "Moch Diki Widianto", | |
"alamat" => "Rangkasbitung, Banten", | |
"jabatan" => "CEO Baduytech Solutions" | |
], | |
[ | |
"nama" => "Asep Mularwan", | |
"alamat" => "Bandung, Jawa Barat", |
This file contains 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 | |
$angka_pertama = 11; | |
$angka_kedua = 20; | |
$kondisi = "penjumlahan"; | |
switch ($kondisi) { | |
case 'penjumlahan': | |
if($angka_pertama > 10){ | |
$hasil = "Angka Pertama harus dibawah 10"; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Belajar Fungsi</title> | |
</head> | |
<body> | |
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" autocomplete="off"> | |
<p>Panjang</p> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Tailwind CSS</title> | |
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div class="flex px-3 py-3"> |
OlderNewer