post
function post($var, $default = null)
Returns element with name specified in the first parameter from the $_POST array. If element is not found, returns default value, specified in the second parameter. This function is useful for form processing.
Parameters
- $var - string. Specifies POST element name to return.
- $default - mixed, default NULL. Specifies a default element value.
Return value
Returns mixed value.
Examples
The following code fetches the 'name' POST element and if there is no such element, uses string "John".
$name = post('name', 'John');Next: post_array_item
Previous: option_state
Return to Reference

