Show Menu
Cheatography

PHP Cheat Sheet (DRAFT) by

Jet Flights PHP Cheat Sheet

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

Condit­ionals and Booleans

if (expr) statement
elseif (expr) statement
foreach ( [Array] as $value) statement

Function

function name() {
    //
}
 

Basic

.
Concat­enation Operator
Print Text
<?php echo "­Hello World"; ?>
Print Text Short Version
<?= "­Hello World" ?>
Loop php while writing HTML
<?php foreach ($Books as $Book) : ?>

<?php endfor­each; ?>you can write html between php loops
Create a variable with $
$Variable = "­xxx­"
Create Array
$Variable = ["op­tio­nal­Key­" => "­xxx­"]

Array and Methodes

add to Array
$Array[] = $Item