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.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode is_array in_array end
last run:
2023-11-12 20:48:05
13
- PHP 8.2.13 / MySQL 8.0 in_array print_r microtime
last run:
2024-03-30 16:28:44
12
- PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode print_r array_count_values is_array in_array end
last run:
2023-11-01 18:08:32
9
- PHP 8.0 / MySQL 5.7 preg_match_all in_array array_pop
last run:
2021-05-08 14:32:11
9
- PHP 8.1 / MySQL 5.7 in_array var_dump
last run:
2023-12-29 11:22:48
7
- PHP 8.0 / MySQL 5.7 in_array
last run:
2022-02-13 07:37:11
6
- PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode print_r is_array in_array end array_count_values
last run:
2023-11-03 16:58:32
5
- 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
in_array - New snippets
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2024-04-23 12:09:03
1
-
PHP 8.1 / MySQL 5.7 in_array
added at:
2024-04-23 12:08:51
1
-
PHP 8.2.13 / MariaDB 10 explode print_r in_array
added at:
2024-04-06 15:13:44
1
-
PHP 8.2.13 / MySQL 8.0 explode print_r in_array
added at:
2024-04-04 00:09:14
1
-
PHP 8.2.13 / MySQL 8.0 in_array
added at:
2024-04-04 00:04:57
1
-
PHP 8.2.13 / MySQL 8.0 explode print_r in_array
added at:
2024-04-04 00:04:18
1
-
PHP 8.2.13 / MySQL 8.0 in_array print_r microtime in_array print_r microtime
added at:
2024-04-03 23:40:39
1
-
PHP 8.1 / MySQL 5.7 array_map trim stristr array_filter in_array array_count_values print_r
added at:
2024-03-30 18:08:00
1
-
PHP 8.1 / MySQL 5.7 array_map trim stristr array_filter in_array array_count_values print_r
added at:
2024-03-30 18:07:51
1