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 8.1 / MySQL 5.7 in_array
added at:
2023-08-30 06:30:27
1
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2023-08-30 06:28:51
1
-
PHP 8.2.3 / MySQL 5.7 in_array
added at:
2023-08-13 07:00:03
2
-
PHP 8.2.3 / MySQL 5.7 in_array
added at:
2023-08-13 06:59:51
1
-
PHP 8.2.3 / MySQL 5.7 in_array
added at:
2023-08-13 06:59:40
1
-
PHP 8.2.3 / MySQL 5.7 in_array
added at:
2023-08-13 06:59:23
1
-
PHP 8.1 / MySQL 5.7 trim var_export in_array
added at:
2023-07-06 18:14:33
1
-
PHP 8.1 / MySQL 5.7 var_dump in_array
added at:
2023-06-22 10:48:40
1
-
PHP 8.1 / MySQL 5.7 var_dump in_array
added at:
2023-06-22 10:48:33
2
-
PHP 8.1 / MySQL 5.7 var_dump in_array
added at:
2023-06-22 10:48:14
1