Skip to main content

register_variable

Function register_variable 

Source
pub fn register_variable(
    array: &mut Array,
    name: &[u8],
    value: Value,
    keep_existing: bool,
)
Expand description

php_register_variable_ex($name, $value, $array): registers one request variable the way PHP fills $_GET, $_POST and $_COOKIE. Leading spaces are dropped, . and in the base name become _, name[a][] builds nested arrays (at most MAX_INPUT_NESTING_LEVEL levels; deeper names drop the whole variable), and an unterminated [ is kept as _.

keep_existing is the $_COOKIE rule: a top-level name that is already set is not overwritten.