In PHP 5.2 there was a nice security function added called \"input_filter\", so instead of saying:
$name = $_GET[\'name\'];
you can now say
A handy way to do this without modifying the global array:
if (!($name = filter_input(INPUT_GET, 'name'))) { $name = 'default_value'; }
Or using the ternary operator:
$name = ($name = filter_input(INPUT_GET, 'name')) ? $name : 'default_value';