Return to Snippet

Revision: 39607
at January 19, 2011 02:37 by ramy


Initial Code
function cleanGlobal($global_array, $arg, $specialchars = true, $default = null) {
	if(key_exists($arg, $global_array) && $global_array[$arg] != null && $global_array[$arg] != "") {
		if($specialchars) {
			return htmlspecialchars($global_array[$arg]);
		} else {
			return $global_array[$arg];
		}
	} else {
		return $default;
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Clean and get global variable

Initial Tags
post

Initial Language
PHP