This is a draft cheat sheet. It is a work in progress and is not finished yet.
Opening and Closing tags
<?php ?>
<? ?>
<script language="php"> </script>
<% %> |
Comments
/*
Multi - line
*/
// Single Line
# Single Line |
Variables and Functions
$var1 = "Varaible content";
static $var = 5;
function fname($var1, $default = "data")
{
data
}
$reference = &$referenced; |
Useful Functions
nl2br($var); |
$is_type($var); |
define('NAME', $value); |
include($file); // include _once |
require($file); // require_once |
array_search("search", $arr); |
trim($var); // ltrim and rtrim |
strpos($data, $value); |
substr($var, $start, $endoptional); |
|
|
|
|
|