Tagged articles
5 articles
Page 1 of 1
php Courses
php Courses
May 24, 2024 · Backend Development

Using array_reduce() in PHP: Syntax, Parameters, and Practical Examples

This article explains PHP's array_reduce() function, detailing its syntax and parameters, and demonstrates its usage through three examples: summing numbers, concatenating strings, and calculating product, helping beginners understand how to reduce arrays to a single value with callbacks.

CallbacksPHParray manipulation
0 likes · 4 min read
Using array_reduce() in PHP: Syntax, Parameters, and Practical Examples
php Courses
php Courses
Jan 12, 2024 · Backend Development

Four Ways to Reverse an Array in PHP

This article demonstrates four methods to reverse a PHP array—including the built‑in array_reverse() function, a manual for‑loop swap, an array_reduce() technique, and a combination of array_multisort() with array_column()—explaining their usage, code examples, and output results.

BackendPHParray_column
0 likes · 6 min read
Four Ways to Reverse an Array in PHP
Laravel Tech Community
Laravel Tech Community
Nov 18, 2020 · Backend Development

Using array_reduce() with a Callback to Reduce an Array to a Single Value

This article explains PHP's array_reduce() function, describing its parameters, behavior, and how a callback can iteratively process an input array to produce a single result, accompanied by example code demonstrating summation, multiplication, handling of empty arrays, and output inspection.

Backendarray reductionarray_reduce
0 likes · 3 min read
Using array_reduce() with a Callback to Reduce an Array to a Single Value