Php 7 Cheat Sheet

Posted : admin On 1/2/2022
Php

Php 7 Cheat Sheet Download


Is this a piece of cake for you? Then check the PHP Syntax Exam :-)
The PHP Documentation Group has now added the Appendix K. PHP type comparison tables to the official PHP manual.

Empty() & Co, Special Values

gettype()empty()is_null()isSet()(bool)
$x = ';stringtruefalsetruefalse
$x = null;NULLtruetruefalsefalse
var $x; (not set)NULLtruetruefalsefalse
$x = array();arraytruefalsetruefalse
$x = false;booleantruefalsetruefalse
$x = 15;integerfalsefalsetruetrue
$x = 1;integerfalsefalsetruetrue
$x = 0;integertruefalsetruefalse
$x = -1;integerfalsefalsetruetrue
$x = '15';stringfalsefalsetruetrue
$x = '1';stringfalsefalsetruetrue
$x = '0';stringtruefalsetruefalse
$x = '-1';stringfalsefalsetruetrue
$x = 'foo';stringfalsefalsetruetrue
$x = 'true';stringfalsefalsetruetrue
$x = 'false';stringfalsefalsetruetrue

Note: empty() and isSet() don't give a warning when the variable has not been defined before.

A windows-like file manager to organize your remote files. more ...

comparison with

truefalse10-1'1''0''-1''1.3''1.30'1.31.30array()'foo''
truetruefalsetruefalsetruetruefalsetruetruetruetruetruefalsetruefalse
falsefalsetruefalsetruefalsefalsetruefalsefalsefalsefalsefalsetruefalsetrue
1truefalsetruefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalse
0falsetruefalsetruefalsefalsetruefalsefalsefalsefalsefalsefalsetruetrue
-1truefalsefalsefalsetruefalsefalsetruefalsefalsefalsefalsefalsefalsefalse
'1'truefalsetruefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalse
'0'falsetruefalsetruefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalse
'-1'truefalsefalsefalsetruefalsefalsetruefalsefalsefalsefalsefalsefalsefalse
'1.3'truefalsefalsefalsefalsefalsefalsefalsetruetruetruetruefalsefalsefalse
'1.30'truefalsefalsefalsefalsefalsefalsefalsetruetruetruetruefalsefalsefalse
1.3truefalsefalsefalsefalsefalsefalsefalsetruetruetruetruefalsefalsefalse
1.30truefalsefalsefalsefalsefalsefalsefalsetruetruetruetruefalsefalsefalse
array()falsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsetruefalsefalse
'foo'truefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsetruefalse
'falsetruefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsetrue

comparison with

truefalse10-1'1''0''-1''1.3''1.30'1.31.30array()'foo''
truetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse
falsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse
1falsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse
0falsefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse
-1falsefalsefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse
'1'falsefalsefalsefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalsefalse
'0'falsefalsefalsefalsefalsefalsetruefalsefalsefalsefalsefalsefalsefalsefalse
'-1'falsefalsefalsefalsefalsefalsefalsetruefalsefalsefalsefalsefalsefalsefalse
'1.3'falsefalsefalsefalsefalsefalsefalsefalsetruefalsefalsefalsefalsefalsefalse
'1.30'falsefalsefalsefalsefalsefalsefalsefalsefalsetruefalsefalsefalsefalsefalse
1.3falsefalsefalsefalsefalsefalsefalsefalsefalsefalsetruetruefalsefalsefalse
1.30falsefalsefalsefalsefalsefalsefalsefalsefalsefalsetruetruefalsefalsefalse
array()falsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsetruefalsefalse
'foo'falsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsetruefalse
'falsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsetrue

Php 7 Cheat Sheet

SheetCheat

Php 7 Cheat Sheet Free

Php 7 Cheat SheetCheat

A quick reference guide for PHP, with functions references, a regular expression syntax guide and a reference for PHP's date formating functions. As of 28/6/14, the cheat sheet now includes popup links to the appropriate PHP manual pages.

Php 7 Cheat Sheet Printable

In comparison tables, the left-top table header will indicate the comparison used and link to the relevant page in the PHP Manual. In test tables, the left top table header indicates the type of tests. Both this header as well as most column headers link to their respective relevant PHP Manual pages. A PHP cheat sheet is a reference guide for a user which consists of all the important syntax to accomplish a task. A user can save lots of time using a PHP cheat sheet as no need to search the whole Internet for a small code to perform a specific task. A beginner can have all the PHP codes available in a single document at all times.