Linki
Snippety
- other
error_reporting(E_STRICT); // E_ALL
htmlspecialchars(string)
print_r($_SERVER)
print_r($GLOBALS)
// echo current time
date_default_timezone_set('Europe/Warsaw');
echo "hi " . date('Y-m-d H:i:s'); - stringi
$pos = strpos($s, "x"); if ($pos !== FALSE) { echo substr($s, 0, $pos); }
- regex
$uri = preg_replace('/-en$/', '', $uri);
if ( preg_match('/^.*-en$/', $uri) == 1) - syntax
for ($i = 1; $i <= 10; $i++) { echo $i; }
function insert_html_file($html_file_name) {
print($html_file_name);
} - tablice
echo count($a);
- variables
$uri = $_ENV['REQUEST_URI'];
$path = $_SERVER['DOCUMENT_ROOT'];
$urlGetVariable = $_GET["test"];