src/Objects.php
public static function attrToArray($object){
        if(is_array($object) || is_object($object)) {
            $result = [];
            foreach ($object as $key => $value) {
                $result[$key] = self::attrToArray($value);
            }
            return $result;
        }
        return $object;
    }
public static function attrToArray($object){
        if(is_array($object) || is_object($object)) {
            $result = [];
            foreach ($object as $key => $value) {
                $result[$key] = self::attrToArray($value);
            }
            return $result;
        }
        return $object;
    }
public static function attrToArray ( $ object ) { if ( is_array ( $ object ) || is_object ( $ object ) ) { $ result = [ ] ; foreach ( $ object as $ key => $ value ) { $ result [ $ key ] = self :: attrToArray ( $ value ) ; } return $ result ; } return $ object ; }
Extract attributes object in array.
@param object|array $object
@return array
Extract attributes object in array .