ArrayUtil::get_value_or_default( array $array, string $key, null $default = null )
Gets the value for a given key from an array, or a default value if the key doesn’t exist in the array.
Description Description
Parameters Parameters
- $array
-
(Required) The array to get the value from.
- $key
-
(Required) The key to use to retrieve the value.
- $default
-
(Optional) The default value to return if the key doesn't exist in the array.
Default value: null
Return Return
(mixed|null) The value for the key, or the default value passed.
Source Source
File: src/Utilities/ArrayUtil.php