public static function array_diverse($array)
    {
        $result = array();

        foreach ($array as $key1 => $value1) {
            if (is_array($value1)) {
                foreach ($value1 as $key2 => $value2) {
                    $result[$key2][$key1] = $value2;
                }
            } else {
                $result[0][$key1] = $value1;
            }
        }

        return $result;
    }
public static function array_diverse($array)
    {
        $result = array();

        foreach ($array as $key1 => $value1) {
            if (is_array($value1)) {
                foreach ($value1 as $key2 => $value2) {
                    $result[$key2][$key1] = $value2;
                }
            } else {
                $result[0][$key1] = $value1;
            }
        }

        return $result;
    }
public static function array_diverse ( $ array ) { $ result = array ( ) ; foreach ( $ array as $ key1 => $ value1 ) { if ( is_array ( $ value1 ) ) { foreach ( $ value1 as $ key2 => $ value2 ) { $ result [ $ key2 ] [ $ key1 ] = $ value2 ; } } else { $ result [ 0 ] [ $ key1 ] = $ value1 ; } } return $ result ; }
Diverse array with a specific value

@param  [type] $array [description]
@return array [type]        [description]
Diverse array with a specific value