<?php
$filter = array(
"grant_type" => array("filter" => FILTER_VALIDATE_REGEXP, "options" => array("regexp" => "/^(authorization_code|password|assertion|refresh_token|none)$/"), "flags" => FILTER_REQUIRE_SCALAR),
"scope" => array("flags" => FILTER_REQUIRE_SCALAR),
"code" => array("flags" => FILTER_REQUIRE_SCALAR),
"redirect_uri" => array("filter" => FILTER_SANITIZE_URL),
"username" => array("flags" => FILTER_REQUIRE_SCALAR),
"password" => array("flags" => FILTER_REQUIRE_SCALAR),
"assertion_type" => array("flags" => FILTER_REQUIRE_SCALAR),
"assertion" => array("flags" => FILTER_REQUIRE_SCALAR),
"refresh_token" => array("flags" => FILTER_REQUIRE_SCALAR),
"user_id" => array("filter" => FILTER_VALIDATE_INT),
);
$arResult["user_id"] = 1234;
$arResult["client_id"] = $client_id;
$arResult = filter_var_array($arResult, $filter);
var_dump($arResult);
preferences:
65.89 ms | 405 KiB | 5 Q