Function __global->array_search
Definitions
sources_custom/phpstub.php
- Searches the array for a given value and returns the corresponding key if successful.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $needle | mixed | No | No | required parameter | N/A | N/A | Needle |
| $haystack | array | No | No | required parameter | N/A | N/A | Haystack |
Returns
- The key (false: not found)
- Type: ~mixed
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Searches the array for a given value and returns the corresponding key if successful.
*
* @param mixed $needle Needle
* @param array $haystack Haystack
* @return ~mixed The key (false: not found)
*/
function array_search($needle, array $haystack)
* Searches the array for a given value and returns the corresponding key if successful.
*
* @param mixed $needle Needle
* @param array $haystack Haystack
* @return ~mixed The key (false: not found)
*/
function array_search($needle, array $haystack)
