本文整理匯總了PHP中vmRequest::_cleanVar方法的典型用法代碼示例。如果您正苦於以下問題:PHP vmRequest::_cleanVar方法的具體用法?PHP vmRequest::_cleanVar怎麽用?PHP vmRequest::_cleanVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vmRequest
的用法示例。
在下文中一共展示了vmRequest::_cleanVar方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get
/**
* Fetches and returns a request array.
*
* The default behaviour is fetching variables depending on the
* current request method: GET and HEAD will result in returning
* $_GET, POST and PUT will result in returning $_POST.
*
* You can force the source by setting the $hash parameter:
*
* post $_POST
* get $_GET
* files $_FILES
* cookie $_COOKIE
* env $_ENV
* server $_SERVER
* method via current $_SERVER['REQUEST_METHOD']
* default $_REQUEST
*
* @static
* @param string $hash to get (POST, GET, FILES, METHOD)
* @param int $mask Filter mask for the variable
* @return mixed Request hash
* @since 1.1
*/
function get($hash = 'default', $mask = 0)
{
$hash = strtoupper($hash);
if ($hash === 'METHOD') {
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
switch ($hash) {
case 'GET':
$input = $_GET;
break;
case 'POST':
$input = $_POST;
break;
case 'FILES':
$input = $_FILES;
break;
case 'COOKIE':
$input = $_COOKIE;
break;
case 'SESSION':
$input = $_SESSION;
break;
case 'ENV':
$input =& $_ENV;
break;
case 'SERVER':
$input =& $_SERVER;
break;
default:
$input = $_REQUEST;
break;
}
$result = vmRequest::_cleanVar($input, $mask);
// Handle magic quotes compatability
if (get_magic_quotes_gpc() && $hash != 'FILES') {
$result = vmRequest::_stripSlashesRecursive($result);
}
return $result;
}