public static function get($name, $type='string', $default=NULL) {

		$val = "";

		switch ($_SERVER['REQUEST_METHOD']) {

			case 'GET':
				$request = &$_GET;
				break;
				
			case 'POST':
				$request = &$_POST;
				break;
			
			default:
				$request = &$_REQUEST;
				break;
				
		}
					
		// remove [] from array
		if (substr($name, -2) == '[]') {
			$name = substr($name, 0, -2);
		}
		
		// seeking a possible name
		if (array_key_exists($name, $request)) {
			
			// evaluates whether it’s an array
			if (is_array($request[$name])) {
				
				$values = array();

				foreach ($request[$name] as $val) {
					$values[] = self::castTo($val, $type);
				}
				
				return $values;

			} else {

				return self::castTo($request[$name], $type);

			}

		} else {

			return self::castTo($default, $type);

		}
		
	}