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.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 8.0 / MySQL 5.7 in_array
last run:
2022-02-13 07:37:11
6
- PHP 7.4 / MariaDB 10 in_array addslashes implode
last run:
2024-06-28 13:15:49
5
- 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
in_array - New snippets
-
PHP 8.1 / MySQL 8.0 array_walk in_array
added at:
2024-07-10 14:06:46
1
-
PHP 8.1 / MySQL 8.0 array_walk in_array
added at:
2024-07-10 14:06:30
1
-
PHP 8.1 / MySQL 8.0 in_array
added at:
2024-07-10 13:33:10
6
-
PHP 8.1 / MySQL 8.0 count in_array
added at:
2024-07-10 13:33:03
1
-
PHP 8.1 / MySQL 8.0 count in_array
added at:
2024-07-10 12:57:23
1
-
PHP 7.4 / MariaDB 10 in_array addslashes implode
added at:
2024-06-24 21:31:28
5
-
PHP 7.4 / MariaDB 10 array_column is_array in_array implode
added at:
2024-06-24 21:29:23
1
-
PHP 7.4 / MariaDB 10 array_column is_array in_array implode
added at:
2024-06-24 21:29:16
1
-
PHP 7.4 / MariaDB 10 array_column is_array in_array addslashes implode
added at:
2024-06-24 21:10:02
1
-
PHP 8.2.13 / MariaDB 10 array_column is_array in_array addslashes implode
added at:
2024-06-24 21:09:45
1