View Single Post
Old 01-04-2006, 04:09 AM   PM User | #4
missing-score
Senior Coder


 
missing-score's Avatar
 
Join Date: Jan 2003
Location: UK
Posts: 2,194
Thanks: 0
Thanked 0 Times in 0 Posts
missing-score is on a distinguished road
PHP Code:
function array_walk_recursive( &$input$funcname$userdata NULL ){

    foreach( 
$input as $key => $data ){

        if( 
is_array$data ) ){

            
array_walk_recursive$input[$key], $funcname$userdata );

        } else {

            if( 
is_array$funcname ) ){

                
$obj $funcname[0];
                
$method $funcname[1];
                
                
$obj->$method$data$key$userdata );
            
            } else {
            
                
$funcname$data$key$userdata );
                
            }
        
        }
    
    }


array_walk_recursive for PHP4 servers... if you use the code above, but put it inside:

PHP Code:
if( !function_exists'array_walk_recursive' ) ){  /*   CODE ABOVE HERE   */ 
You can safely use it in PHP4 and PHP5 environments.

Last edited by missing-score; 01-04-2006 at 04:41 AM..
missing-score is offline   Reply With Quote