Complete PHP Array Reference
The array_reduce() function sends the values in an array to a user-defined function, and returns a string.
| Parameter | Description |
|---|---|
| array | Required. Specifies an array |
| function | Required. Specifies the name of the function |
| initial | Optional. Specifies the initial value to send to the function |
The output of the code above will be:
With the initial parameter:
The output of the code above will be:
Returning a sum:
The output of the code above will be:
Complete PHP Array Reference
Your message has been sent to W3Schools.