array_search
array_search — Searches the array for a given value and returns the first corresponding key if successful.Description
array_search( mixed $needle,Searches for needle in haystack.
array $haystack,
bool $strict = false ): int|string|false
Parameters
needle
The searched value.
haystack
The array.
strict
If the third parameter strict is set to true then the array_search() function will search for identical elements in the haystack. This means it will also perform a strict type comparison of the needle in the haystack, and objects must be the same instance.
Return Values
Returns the key for needle if it is found in the array, false otherwise.More information about array_search on official PHP documentation site
array_search - Popular snippets
- PHP 8.0 / MySQL 5.7 array_search
last run:
2022-04-28 18:43:35
27
- PHP 8.0 / MySQL 5.7 array_search var_export
last run:
2021-08-14 23:02:58
11
- PHP 7.4 / MySQL 5.7 array_search var_export
last run:
2021-08-13 14:53:45
7
- PHP 8.0 / MySQL 5.7 array_search end array_map implode print_r
last run:
2021-09-17 13:44:03
6
- PHP 7.4 / MySQL 5.7 array_keys print_r usort array_search
last run:
2022-01-03 21:23:02
5
- PHP 5.6 / MySQL 5.7 array_search min print_r
last run:
2022-12-19 11:46:24
3
- PHP 8.1 / MySQL 5.7 print_r array_map array_merge array_search array_column
last run:
2022-06-21 13:19:13
3
- PHP 8.0 / MySQL 5.7 array_search
last run:
2022-04-28 16:31:17
3
- PHP 8.0 / MySQL 5.7 array_search
last run:
2022-04-28 16:42:24
3
- PHP 8.0 / MySQL 5.7 array_search
last run:
2022-04-28 16:07:42
3
array_search - New snippets
-
PHP 8.1 / MySQL 5.7 array_search
added at:
2023-02-07 19:29:51
1
-
PHP 8.1 / MySQL 5.7 array_search
added at:
2023-02-07 19:29:42
1
-
PHP 8.1 / MySQL 5.7 array_search
added at:
2023-02-07 19:29:37
1
-
PHP 8.1 / MySQL 5.7 array_search
added at:
2023-02-07 19:29:33
1
-
PHP 8.1 / MySQL 5.7 array_search
added at:
2023-02-07 19:29:26
1
-
PHP 8.1 / MySQL 5.7 array_unique array_values rsort array_search printf
added at:
2023-01-10 04:39:38
1
-
PHP 8.1 / MySQL 5.7 array_unique array_values rsort array_search printf
added at:
2023-01-10 04:39:31
1
-
PHP 8.1 / MySQL 5.7 array_unique array_values rsort array_search printf
added at:
2023-01-08 14:54:04
2
-
PHP 8.1 / MySQL 5.7 array_unique array_values sort array_search printf
added at:
2023-01-08 14:53:52
1
-
PHP 8.1 / MySQL 5.7 array_unique array_values array_search printf
added at:
2023-01-08 14:51:14
1