array_reduce
array_reduce — Iteratively reduce the array to a single value using a callback function.Description
array_reduce( array $array,array_reduce() applies iteratively the callback function to the elements of the array, so as to reduce the array to a single value.
callable $callback,
mixed $initial = null ): mixed
Parameters
Return Values
Returns the resulting value.If the array is empty and initial is not passed, array_reduce() returns null.
More information about array_reduce on official PHP documentation site
array_reduce - Popular snippets
- PHP 8.0 / array_reduce print_r array_values
last run:
2024-07-30 12:01:20
29
- PHP 8.0 / var_export json_decode array_reduce array_values
last run:
2023-11-30 18:57:30
29
- PHP 8.0 / str_getcsv array_reduce
last run:
2024-12-19 08:09:55
26
- PHP 8.1 / array_map count min max array_values array_reduce print_r
last run:
2022-10-19 12:12:55
16
- PHP 7.4 / array_reduce array_merge unserialize array_count_values arsort
last run:
2021-10-20 07:49:30
14
- PHP 7.4 / array_reduce print_r
last run:
2024-07-29 17:27:30
13
- PHP 8.0 / array_reduce array_merge unserialize print_r array_count_values
last run:
2023-10-19 10:30:42
13
- PHP 8.0 / mt_rand strtotime array_reduce date is_null print_r
last run:
2021-11-11 15:08:49
11
- / array_reduce array_merge unserialize print_r array_count_values
last run:
2021-10-19 13:38:35
11
- PHP 8.0 / mt_rand strtotime array_reduce date is_null print_r
last run:
2021-11-11 15:09:28
10
array_reduce - New snippets
-
PHP 8.0 / MariaDB 11.4 str_getcsv array_reduce
added at:
2025-02-10 22:30:32
2
-
PHP 8.1 / MySQL 8.0 json_decode array_reduce var_export array_values
added at:
2025-02-06 19:29:09
1
-
PHP 8.1 / MySQL 8.0 json_decode array_reduce
added at:
2025-02-06 19:28:56
1
-
PHP 8.1 / MySQL 8.0 json_decode array_reduce
added at:
2025-02-06 19:28:30
1
-
PHP 8.1 / MySQL 8.0 var_export json_decode array_reduce array_values var_export json_decode array_reduce array_values
added at:
2025-02-06 15:05:54
1
-
PHP 8.1 / var_dump array_reduce round
added at:
2024-11-01 15:26:49
1
-
PHP 8.1 / var_dump array_reduce round
added at:
2024-11-01 15:26:34
1
-
PHP 8.1 / var_dump array_reduce round
added at:
2024-11-01 15:25:05
1
-
PHP 8.1 / var_dump array_reduce round
added at:
2024-11-01 15:23:54
1