in_array
in_array — Checks if a value exists in an array.Description
in_array( mixed $needle,Searches for needle in haystack using loose comparison unless strict is set.
array $haystack,
bool $strict = false ): bool
Parameters
needle
The searched value.
haystack
The array.
strict
If the third parameter strict is set to true then the in_array() function will also check the types of the needle in the haystack.
Return Values
Returns true if needle is found in the array, false otherwise.More information about in_array on official PHP documentation site
in_array - Popular snippets
- PHP 8.0 / MySQL 5.7 preg_match_all in_array array_pop
last run:
2021-05-08 14:32:11
9
- PHP 8.0 / MySQL 5.7 in_array
last run:
2022-02-13 07:37:11
6
- PHP 7.4 / MySQL 5.7 mt_rand in_array
last run:
2023-03-15 11:44:03
5
- PHP 8.1 / MySQL 5.7 json_decode array_push print_r in_array
last run:
2022-08-24 18:38:18
5
- PHP 8.1 / MySQL 5.7 json_decode json_encode array_push print_r in_array
last run:
2022-08-24 18:32:21
5
- PHP 8.0 / MySQL 5.7 explode count in_array copy
last run:
2022-06-30 20:45:20
5
- PHP 8.0 / MySQL 5.7 array_filter in_array var_dump
last run:
2021-08-24 04:56:36
5
- PHP 8.1 / MySQL 5.7 json_decode print_r in_array
last run:
2022-08-24 18:31:09
4
- PHP 8.0 / MySQL 5.7 array_filter in_array print_r
last run:
2022-03-18 16:35:04
4
- PHP 8.0 / MySQL 5.7 usort in_array print_r
last run:
2022-01-18 17:41:47
4
in_array - New snippets
-
PHP 7.4 / MySQL 5.7 mt_rand in_array
added at:
2023-03-15 11:43:55
5
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2023-02-12 17:23:55
2
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2023-02-12 17:23:32
1
-
PHP 8.1 / MySQL 5.7 in_array var_dump
added at:
2023-02-12 17:10:53
1
-
PHP 8.1 / MySQL 5.7 in_array var_dump
added at:
2023-01-30 13:41:57
3
-
PHP 8.1 / MySQL 5.7 in_array var_dump
added at:
2023-01-30 13:41:41
1
-
PHP 8.0 / MySQL 8.0 count in_array print_r
added at:
2023-01-21 04:32:28
1
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2022-12-29 01:56:56
1
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2022-12-29 01:56:28
1
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2022-12-29 01:56:12
1