$foo = Options::get('foo'); // returns null if the option 'foo' does not exist
list($foo, $bar, $baz) = Options::get( array('foo1', 'bar2', 'baz3') ); // useful with array_keys()
$bar = Options::get('foo', 'bar'); // returns 'bar' if the option 'foo' does not exist. useful for avoiding if/then blocks to detect unset options
public static get ( string | array $name, mixed $default_value = null ) : mixed | ||
$name | string | array | The name or an array of names of the option to fetch. |
$default_value | mixed | The value to return for an option if it does not exist. |
return | mixed | The option requested or an array of requested options, $default_value for each if the option does not exist |