public static function toAssociative($array, $recursive = false) {
        $associative = new AssociativeArray();

        foreach($array as $key => $value) {
            if ($recursive && is_array($value)) {
                $associative[$key] = self::toAssociative($value, true);
            } else {
                $associative[$key] = $value;
            }
        }

        return $associative;

    }
public static function toAssociative($array, $recursive = false) {
        $associative = new AssociativeArray();

        foreach($array as $key => $value) {
            if ($recursive && is_array($value)) {
                $associative[$key] = self::toAssociative($value, true);
            } else {
                $associative[$key] = $value;
            }
        }

        return $associative;

    }
public static function toAssociative ( $ array , $ recursive = false ) { $ associative = new AssociativeArray ( ) ; foreach ( $ array as $ key => $ value ) { if ( $ recursive && is_array ( $ value ) ) { $ associative [ $ key ] = self :: toAssociative ( $ value , true ) ; } else { $ associative [ $ key ] = $ value ; } } return $ associative ; }
Convert a regular array to an associative array. optionally recursive is required.

@param $array
@param bool $recursive
Convert a regular array to an associative array . optionally recursive is required .