The What
Description
This construct, array_walk
, is similar to foreach
, as it iterates through each element in the given array. However, unlike foreach
, it does not affect the array’s internal pointer and the element’s key/value pair are passed to a callback for processing.
Parameters
given_array
- The array to loop through and pass each element’s key/value pair to the callback.
callback
- The callable to be called (invoked) for each element within the array. It will take two parameters: (1) the element’s value as the first parameter, and (2) the key/index as the second parameter.
userdata
- optional If you want to pass a third parameter to the callback, you use the
userdata
option.
Return Values
Returns TRUE
if it successfully walks through the array; else you will get a FALSE
back from it.
Hey... hey you... yes you!... Having a good time? Learning new things? Good!
More coming soon…keep checking back.