This is a draft cheat sheet. It is a work in progress and is not finished yet.
Getting Started
Programs needed: |
Laragon or XXAMP |
PHP itself |
VS Code as Editor |
Code Editor |
TablePlus |
Similar to MYSql |
Conditionals and Booleans
|
if (expr) statement |
|
elseif (expr) statement |
|
foreach ( [Array] as $value) statement |
|
|
Basic
. |
Concatenation Operator |
Print Text |
<?php echo "Hello World"; ?> |
Print Text Short Version |
<?= "Hello World" ?> |
Loop php while writing HTML |
<?php foreach ($Books as $Book) : ?> <?php endforeach; ?>you can write html between php loops |
Create a variable with $ |
$Variable = "xxx" |
Create Array |
$Variable = ["optionalKey" => "xxx"] |
Array and Methodes
add to Array |
$Array[] = $Item |
|