public function toKeyValue(array $values)
    {
        $result = [];

        foreach ($values as $key => $value) {
            if (is_array($value)) {
                $result[$key] = $this->toKeyValue($value);
            } elseif (is_object($value)) {
                $result[$key] = $this->toKeyValue((array) $value);
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
public function toKeyValue(array $values)
    {
        $result = [];

        foreach ($values as $key => $value) {
            if (is_array($value)) {
                $result[$key] = $this->toKeyValue($value);
            } elseif (is_object($value)) {
                $result[$key] = $this->toKeyValue((array) $value);
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
public function toKeyValue ( array $ values ) { $ result = [ ] ; foreach ( $ values as $ key => $ value ) { if ( is_array ( $ value ) ) { $ result [ $ key ] = $ this -> toKeyValue ( $ value ) ; } elseif ( is_object ( $ value ) ) { $ result [ $ key ] = $ this -> toKeyValue ( ( array ) $ value ) ; } else { $ result [ $ key ] = $ value ; } } return $ result ; }
Transform the given array of values into a key-value pair recursively.

@param array $values

@return array
Transform the given array of values into a key - value pair recursively .