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 / 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 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
in_array - New snippets
-
PHP 8.1 / Oracle Database 21c json_encode json_decode in_array
added at:
2024-10-09 16:43:46
3
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:43:10
1
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:43:03
1
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:42:35
1
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string in_array
added at:
2024-10-09 16:40:17
3
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:36:13
2
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:35:48
1
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:33:35
4
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:32:11
6
-
PHP 8.1 / Oracle Database 21c file_get_contents simplexml_load_string json_encode json_decode in_array
added at:
2024-10-09 16:31:53
1