Skip to content

Instantly share code, notes, and snippets.

View dikiwidia's full-sized avatar
:octocat:
#OpenToWork

Moch Diki Widianto dikiwidia

:octocat:
#OpenToWork
View GitHub Profile
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$wd = strtolower($word);
if ($wd == strrev($wd)){
return true;
}
return false;
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
return function($arg) use ($funcs)
{
//Gunakan Foreach
foreach ($funcs as $func)
{
-- Write only the SQL statement that solves the problem and nothing else.
SELECT COUNT(*) FROM students WHERE firstName = 'John'
-- 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);
@dikiwidia
dikiwidia / fibonacci.php
Last active October 6, 2019 00:20
Fibonacci jumlahkan angka genap dan pergantian string, Rat Maze cari jalan keluar untuk tikus
<?php
// Fungsi Fibonacci
function Fibonacci($batas){
echo "Hasil Deret : ";
$angkaPertama = 1;
$angkaKedua = 2;
//$nKe = 0;
while ($angkaPertama < $batas){
$output = $angkaPertama;
<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;
<?php
$data = [
[
"nama" => "Moch Diki Widianto",
"alamat" => "Rangkasbitung, Banten",
"jabatan" => "CEO Baduytech Solutions"
],
[
"nama" => "Asep Mularwan",
"alamat" => "Bandung, Jawa Barat",
<?php
$angka_pertama = 11;
$angka_kedua = 20;
$kondisi = "penjumlahan";
switch ($kondisi) {
case 'penjumlahan':
if($angka_pertama > 10){
$hasil = "Angka Pertama harus dibawah 10";
<!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>
<!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">