parsing array.

gsingla4u's Avatar, Join Date: Jul 2009
Go4Expert Member
i have to put all the elements of a multidimensional array in a single array.
i have written the code but there is some problem with it.
Here it is:
Code:
<?php
    function parsearray($ary){
        $newArray=array();
        foreach($ary as $val){
            if(is_array($val)){
                parsearray($val);
            }else{
                $newArray[]=$val;
            }
        }
    return $newArray;
    }
    $array=array(2,3,89,34,array(90,1,43));
    $chk=parsearray($array);
    print_r    ( $chk);
?>

also i want a function that search all the elements of multidimensional array and find the biggest one.

Thank you.
gsingla4u's Avatar, Join Date: Jul 2009
Go4Expert Member
i have done it myself.
thanx