├── .gitignore ├── AnonymousFunction.php ├── ArrayFunction.php ├── ArrowFunction.php ├── Break.php ├── CallbackFunction.php ├── Constant.php ├── Continue.php ├── DoWhileLoop.php ├── FactorialFunction.php ├── ForEach.php ├── ForLoop.php ├── Function.php ├── FunctionArgument.php ├── FunctionReturnValue.php ├── GoTo.php ├── HelloWorld.php ├── IfStatement.php ├── IncrementDanDecrement.php ├── IsFunction.php ├── Komentar.php ├── Lib └── MyFunction.php ├── ManipulasiString.php ├── NullCoalescingOperator.php ├── OperatorAritmatika.php ├── OperatorArray.php ├── OperatorLogika.php ├── OperatorPenugasan.php ├── OperatorPerbandingan.php ├── Reference.php ├── RequireDanInclude.php ├── StringFunction.php ├── SwitchStatement.php ├── TernaryOperator.php ├── TipeDataArray.php ├── TipeDataBoolean.php ├── TipeDataNull.php ├── TipeDataNumber.php ├── TipeDataString.php ├── Variable.php ├── VariableFunction.php ├── VariableLocalScope.php ├── VariableScope.php ├── VariableStaticScope.php └── WhileLoop.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### JetBrains template 3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 4 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 5 | 6 | .idea 7 | # User-specific stuff 8 | .idea/**/workspace.xml 9 | .idea/**/tasks.xml 10 | .idea/**/usage.statistics.xml 11 | .idea/**/dictionaries 12 | .idea/**/shelf 13 | 14 | # Generated files 15 | .idea/**/contentModel.xml 16 | 17 | # Sensitive or high-churn files 18 | .idea/**/dataSources/ 19 | .idea/**/dataSources.ids 20 | .idea/**/dataSources.local.xml 21 | .idea/**/sqlDataSources.xml 22 | .idea/**/dynamic.xml 23 | .idea/**/uiDesigner.xml 24 | .idea/**/dbnavigator.xml 25 | 26 | # Gradle 27 | .idea/**/gradle.xml 28 | .idea/**/libraries 29 | 30 | # Gradle and Maven with auto-import 31 | # When using Gradle or Maven with auto-import, you should exclude module files, 32 | # since they will be recreated, and may cause churn. Uncomment if using 33 | # auto-import. 34 | # .idea/artifacts 35 | # .idea/compiler.xml 36 | # .idea/jarRepositories.xml 37 | # .idea/modules.xml 38 | # .idea/*.iml 39 | # .idea/modules 40 | # *.iml 41 | # *.ipr 42 | 43 | # CMake 44 | cmake-build-*/ 45 | 46 | # Mongo Explorer plugin 47 | .idea/**/mongoSettings.xml 48 | 49 | # File-based project format 50 | *.iws 51 | 52 | # IntelliJ 53 | out/ 54 | 55 | # mpeltonen/sbt-idea plugin 56 | .idea_modules/ 57 | 58 | # JIRA plugin 59 | atlassian-ide-plugin.xml 60 | 61 | # Cursive Clojure plugin 62 | .idea/replstate.xml 63 | 64 | # Crashlytics plugin (for Android Studio and IntelliJ) 65 | com_crashlytics_export_strings.xml 66 | crashlytics.properties 67 | crashlytics-build.properties 68 | fabric.properties 69 | 70 | # Editor-based Rest Client 71 | .idea/httpRequests 72 | 73 | # Android studio 3.1+ serialized cache file 74 | .idea/caches/build_file_checksums.ser 75 | 76 | -------------------------------------------------------------------------------- /AnonymousFunction.php: -------------------------------------------------------------------------------- 1 | $value * 10, $data); 6 | var_dump($dataResult); 7 | 8 | rsort($data); 9 | var_dump($data); 10 | 11 | var_dump(array_keys($data)); 12 | var_dump(array_values($data)); 13 | 14 | $person = [ 15 | "first_name" => "Eko", 16 | "last_name" => "Khannedy" 17 | ]; 18 | var_dump(array_keys($person)); 19 | var_dump(array_values($person)); -------------------------------------------------------------------------------- /ArrowFunction.php: -------------------------------------------------------------------------------- 1 | "Hello $firstName $lastName" . PHP_EOL; 11 | 12 | echo $anonymousFunction(); 13 | echo $arrowFunction(); -------------------------------------------------------------------------------- /Break.php: -------------------------------------------------------------------------------- 1 | 10) { 10 | break; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CallbackFunction.php: -------------------------------------------------------------------------------- 1 | strtoupper($name)); -------------------------------------------------------------------------------- /Constant.php: -------------------------------------------------------------------------------- 1 | $name) { 10 | echo "Data ke $index = $name" . PHP_EOL; 11 | } 12 | 13 | foreach ($names as $name) { 14 | echo "Data $name" . PHP_EOL; 15 | } 16 | 17 | $person = [ 18 | "first_name" => "Eko", 19 | "middle_name" => "Kurniawan", 20 | "last_name" => "Khannedy" 21 | ]; 22 | 23 | foreach ($person as $key => $value) { 24 | echo "$key : $value" . PHP_EOL; 25 | } -------------------------------------------------------------------------------- /ForLoop.php: -------------------------------------------------------------------------------- 1 | = 1; $counter--) { 8 | echo "Ini adalah for loop ke-$counter" . PHP_EOL; 9 | } 10 | 11 | for ($counter = 1; $counter <= 10; $counter++): 12 | echo "Ini adalah for loop ke-$counter" . PHP_EOL; 13 | endfor; 14 | 15 | for ($counter = 10; $counter >= 1; $counter--): 16 | echo "Ini adalah for loop ke-$counter" . PHP_EOL; 17 | endfor; -------------------------------------------------------------------------------- /Function.php: -------------------------------------------------------------------------------- 1 | = 80) { 18 | return "A"; 19 | } else if ($value >= 70) { 20 | return "B"; 21 | } else if ($value >= 60) { 22 | return "C"; 23 | } else if ($value >= 50) { 24 | return "D"; 25 | } else { 26 | return "E"; 27 | } 28 | 29 | echo "Ups" . PHP_EOL; 30 | } 31 | 32 | $score = getFinalValue(90); 33 | var_dump($score); 34 | 35 | $score = getFinalValue(30); 36 | var_dump($score); -------------------------------------------------------------------------------- /GoTo.php: -------------------------------------------------------------------------------- 1 | 10) { 16 | goto end; 17 | } 18 | } 19 | 20 | end: 21 | echo "End Loop"; -------------------------------------------------------------------------------- /HelloWorld.php: -------------------------------------------------------------------------------- 1 | = 80 && $absen >= 80) { 7 | echo "Nilai Anda A" . PHP_EOL; 8 | } else if ($nilai >= 70 && $absen >= 70) { 9 | echo "Nilai Anda B" . PHP_EOL; 10 | } else if ($nilai >= 60 && $absen >= 60) { 11 | echo "Nilai Anda C" . PHP_EOL; 12 | } else if ($nilai >= 50 && $absen >= 50) { 13 | echo "Nilai Anda D" . PHP_EOL; 14 | } else { 15 | echo "Nilai Anda E" . PHP_EOL; 16 | } 17 | 18 | if ($nilai >= 80 && $absen >= 80) : 19 | echo "Nilai Anda A" . PHP_EOL; 20 | elseif ($nilai >= 70 && $absen >= 70): 21 | echo "Nilai Anda B" . PHP_EOL; 22 | elseif ($nilai >= 60 && $absen >= 60): 23 | echo "Nilai Anda C" . PHP_EOL; 24 | elseif ($nilai >= 50 && $absen >= 50): 25 | echo "Nilai Anda D" . PHP_EOL; 26 | else : 27 | echo "Nilai Anda E" . PHP_EOL; 28 | endif; -------------------------------------------------------------------------------- /IncrementDanDecrement.php: -------------------------------------------------------------------------------- 1 | "Create" 5 | ]; 6 | $action = $data["action"] ?? "Nothing"; 7 | 8 | echo $action . PHP_EOL; 9 | -------------------------------------------------------------------------------- /OperatorAritmatika.php: -------------------------------------------------------------------------------- 1 | "Eko" 5 | ]; 6 | 7 | $last = [ 8 | "first_name" => "Budi", 9 | "last_name" => "Khannedy" 10 | ]; 11 | 12 | $full = $first + $last; 13 | var_dump($full); 14 | 15 | $a = [ 16 | "first_name" => "Eko", 17 | "last_name" => "Khannedy" 18 | ]; 19 | 20 | $b = [ 21 | "last_name" => "Khannedy", 22 | "first_name" => "Eko" 23 | ]; 24 | 25 | var_dump($a == $b); 26 | var_dump($a === $b); -------------------------------------------------------------------------------- /OperatorLogika.php: -------------------------------------------------------------------------------- 1 | = 9); -------------------------------------------------------------------------------- /Reference.php: -------------------------------------------------------------------------------- 1 | "eko", 24 | "name" => "Eko Kurniawan", 25 | "age" => 30, 26 | "address" => array( 27 | "city" => "Jakarta", 28 | "country" => "Indonesia" 29 | ) 30 | ); 31 | var_dump($eko); 32 | 33 | var_dump($eko["name"]); 34 | var_dump($eko["address"]["country"]); 35 | 36 | $budi = [ 37 | "id" => "budi", 38 | "name" => "Budi Nugraha", 39 | "age" => 35, 40 | "address" => [ 41 | "city" => "Jakarta", 42 | "country" => "Indonesia" 43 | ] 44 | ]; 45 | var_dump($budi); -------------------------------------------------------------------------------- /TipeDataBoolean.php: -------------------------------------------------------------------------------- 1 |