The Developer Tutorials blog has a quick example of how to use the array_walk function to maneuver through the array of your choosing and applying a callback method to each of its elements.
Itâ€™s a common sight: taking an array and running (well, walking) its elements through a particular function. Luckily, PHP provides a simple yet powerful function to overcome this: array_walk().
They include an example, giving a sample "some_function" the array_walk method uses when it's called, replacing a foreach (or other type of loop). Plus you can specify an object with the callback to run it against a method inside a class too.