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.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
- PHP 8.0 / MySQL 5.7 explode count in_array copy
last run:
2022-06-30 20:45:20
5
in_array - New snippets
-
PHP 8.1 / MySQL 5.7 unserialize in_array print_r
added at:
2024-03-13 17:36:34
1
-
PHP 8.1 / MySQL 8.0 in_array
added at:
2024-02-18 08:37:45
1
-
PHP 8.1 / MySQL 8.0 in_array
added at:
2024-02-18 08:35:36
1
-
PHP 8.1 / MySQL 8.0 in_array
added at:
2024-02-18 08:33:59
1
-
PHP 8.1 / MySQL 5.7 in_array print_r
added at:
2024-02-09 09:37:34
1
-
PHP 8.1 / MySQL 5.7 in_array print_r
added at:
2024-02-09 08:30:17
2
-
PHP 8.1 / MySQL 5.7 in_array print_r
added at:
2024-02-09 08:30:15
1
-
PHP 8.1 / MySQL 5.7 in_array print_r
added at:
2024-02-09 08:29:22
2
-
PHP 8.1 / MySQL 5.7 in_array print_r
added at:
2024-02-09 08:28:45
1
-
PHP 8.1 / MySQL 5.7 in_array print_r
added at:
2024-02-09 08:28:04
1