Integer Array.get_key (Mixed val, [Function func = null]) vs. 1.1.0 Full+Lite

Return the array key or index for the given value.

Parameters

Mixed val Required vs. 1.1.0 Full+Lite
The value to search the array value.
Function func (Optional - Default: null) vs. 1.1.0 Full+Lite
A function to process the array values before comparson. This can be used if the array values are not objects that can be compared directly.

Return

Integer Required vs. 1.1.0 Full+Lite
The array key or index for the given value. If the value is not in the array, null will be returned.

Examples

Using Array.get_key(val)
Demo: