update page now

Voting

: max(seven, two)?
(Example: nine)

The Note You're Voting On

ted.devito at 9gmail9 dot 99com
17 years ago
based on worldclimb's arem(), here is a recursive array value removal tool that can work with multidimensional arrays.

function remove_from_array($array,$value){
    $clear = true;
    $holding=array();
   
    foreach($array as $k => $v){
        if (is_array($v)) {
            $holding [$k] = remove_from_array ($v, $value);
            }
        elseif ($value == $v) {
            $clear = false;
            }
        elseif($value != $v){
            $holding[$k]=$v; // removes an item by combing through the array in order and saving the good stuff
        }
    }   
    if ($clear) return $holding; // only pass back the holding array if we didn't find the value 
}

<< Back to user notes page

To Top