News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Developer Tutorials Blog:
PHP array_walk() Run an array through a function
April 23, 2008 @ 08:47:09

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.

2 comments voice your opinion now!
arraywalk function callback object method loop tutorial


blog comments powered by Disqus

Similar Posts

Madarco's DevBlog: Using Zend_Tool in Eclipse

HowToForge.com: Installing Cherokee With PHP5 And MySQL Support On Ubuntu 11.04

Noupe.com: Beautiful Forms - Design, Style, & make it work with PHP & Ajax

Zend Developer Zone: Mobile Platforms Built On Object-Oriented PHP 5

Dave Dash's Blog: Finding things using Zend Search Lucene in symfony


Community Events





Don't see your event here?
Let us know!


api configure language introduction community developer bugfix podcast laravel series library wordpress list release framework interview threedevsandamaybe application install unittest

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework