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.0 / MySQL 5.7 preg_match_all in_array array_pop
last run:
2021-05-08 14:32:11
9
- PHP 8.0 / MySQL 5.7 in_array
last run:
2022-02-13 07:37:11
6
- PHP 8.0 / MySQL 5.7 explode count in_array copy
last run:
2022-06-30 20:45:20
5
- PHP 8.0 / MySQL 5.7 array_filter in_array var_dump
last run:
2021-08-24 04:56:36
5
- PHP 8.0 / MySQL 5.7 array_filter in_array print_r
last run:
2022-03-18 16:35:04
4
- PHP 8.0 / MySQL 5.7 usort in_array print_r
last run:
2022-01-18 17:41:47
4
- PHP 8.0 / MySQL 5.7 explode in_array
last run:
2022-03-24 05:14:33
3
- PHP 7 / MySQL 5.7 in_array
last run:
2021-12-09 05:52:15
3
- PHP 8.0 / MySQL 5.7 in_array is_numeric
last run:
2021-08-08 01:47:27
3
- PHP 8.0 / MySQL 5.7 in_array implode array_keys
last run:
2021-06-09 18:07:21
3
in_array - New snippets
-
PHP 8.1 / MySQL 5.7 strtolower pathinfo in_array json_encode
added at:
2022-07-03 20:57:22
1
-
PHP 8.1 / MySQL 5.7 strtolower pathinfo in_array json_encode
added at:
2022-07-03 13:40:49
2
-
PHP 8.1 / MySQL 5.7 strtolower pathinfo in_array json_encode
added at:
2022-07-03 13:40:37
1
-
PHP 8.1 / MySQL 5.7 strtolower pathinfo in_array json_encode
added at:
2022-07-03 13:40:10
1
-
PHP 7 / MySQL 5.7 strtolower file_exists explode count in_array copy
added at:
2022-06-30 20:46:53
2
-
PHP 5 / MySQL 5.7 explode count in_array copy
added at:
2022-06-30 20:46:17
1
-
PHP 7 / MySQL 5.7 explode count in_array copy
added at:
2022-06-30 20:46:11
2
-
PHP 8.0 / MySQL 5.7 explode count in_array copy
added at:
2022-06-30 20:45:16
5
-
PHP 8.0 / MySQL 5.7 strtolower file_exists explode count in_array copy
added at:
2022-06-30 20:44:28
1
-
PHP 8.1 / MySQL 5.7 array_filter in_array print_r
added at:
2022-06-09 16:29:49
1