mixed fm_get_variable ( string $name
)
Parameters
name
(required)
The name of the variable to get.
Return
Returns the value if the variable exists, otherwise NULL. Keep in mind that there’s a difference between an empty string ‘’ and NULL. It’s perfectly legitimate for a variable to exist and the value to be empty. You can use fm_isset to determine whether or not a variable exists.
Errors
There are no errors for this function.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
fm_set_variable('foo', 'bar'); echo fm_get_variable('foo'); /* Returns: bar */ |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
fm_unset('foo'); $fooecho = gettype(fm_get_variable('foo'); echo gettype($foo); /* Returns: NULL */ |
Change Log
Version | Description |
---|---|
3.0.0 | Returns the variable types now supported by fm_set_variable (bool, int, double, string, array). |