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.2 / MySQL 8.0 in_array print_r microtime
last run:
2024-03-30 16:28:44
12
- PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
last run:
2024-10-09 16:32:45
6
- PHP 8.1 / MySQL 8.0 in_array
last run:
2024-07-10 13:33:13
6
- PHP 7.4 / MariaDB 10 in_array addslashes implode array_column print_r
last run:
2024-06-24 20:48:00
6
- PHP 7.4 / MariaDB 10 in_array addslashes implode
last run:
2024-06-28 13:15:49
5
- PHP 7.4 / MySQL 8.0 mb_strpos in_array
last run:
2025-06-30 02:36:59
4
- PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
last run:
2024-10-09 16:33:56
4
- PHP 7.4 / MySQL 8.0 mb_strpos in_array urldecode mb_substr
last run:
2025-06-30 03:07:04
3
- PHP 8.1 / Oracle Database 21c json_encode json_decode in_array
last run:
2024-10-09 16:43:48
3
- PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string in_array
last run:
2024-10-09 16:40:19
3
in_array - New snippets
-
PHP 8.1 / MySQL 8.0 var_dump in_array pathinfo
added at:
2025-07-07 08:33:54
1
-
PHP 8.1 / MySQL 8.0 var_dump in_array pathinfo
added at:
2025-07-07 08:33:47
1
-
PHP 8.1 / MySQL 8.0 var_dump in_array pathinfo
added at:
2025-07-07 08:33:40
1
-
PHP 7.4 / MySQL 8.0 in_array mb_substr mb_strpos urldecode
added at:
2025-06-30 03:23:15
1
-
PHP 7.4 / MySQL 8.0 mb_strpos in_array
added at:
2025-06-30 02:43:19
2
-
PHP 7.4 / MySQL 8.0 mb_strpos in_array
added at:
2025-06-30 02:43:13
1
-
PHP 7.4 / MySQL 8.0 mb_strpos in_array
added at:
2025-06-30 02:43:03
1
-
PHP 7.4 / MySQL 8.0 mb_strpos in_array
added at:
2025-06-30 02:42:44
1
-
PHP 7.4 / MySQL 8.0 mb_strpos in_array urldecode mb_substr
added at:
2025-06-30 02:40:09
3
-
PHP 7.4 / MySQL 8.0 in_array mb_substr mb_strpos urldecode
added at:
2025-06-30 02:38:38
1