Return to Snippet

Revision: 33545
at October 10, 2010 02:45 by sb_01


Updated Code
$id = abs(intval($id)); // only positiv and complete id's

if(!isset($id) or empty($id) or is_array($id)) {
	return false;
}

$id = 3; // return true
$id = [] // return false
$id = '' // return false

Revision: 33544
at October 10, 2010 00:52 by sb_01


Updated Code
$id = intval($id);

if(!isset($id) or empty($id) or is_array($id)) {
	return false;
}

$id = 3; // return true
$id = [] // return false
$id = '' // return false

Revision: 33543
at October 10, 2010 00:52 by sb_01


Updated Code
$id = intval($id);

if(!isset($id) or empty($id) or is_array($id)) {
	return false;
}

$id = 3; // return false
$id = [] // return false
$id = '' // return false

Revision: 33542
at October 10, 2010 00:50 by sb_01


Initial Code
if(!isset($data['id']) or empty($data['id']) or is_array($data['id'])) {
	return false;
}

Initial URL

                                

Initial Description

                                

Initial Title
ID of POST, GET, COOKIE or SESSION - Validation

Initial Tags
php, post, validation

Initial Language
PHP