public function toArray()
    {
        $data = [];

        for ($this->rewind(); $this->valid(); $this->next()) {
            $data[] = $this->current();
        }

        return $data;
    }
public function toArray()
    {
        $data = [];

        for ($this->rewind(); $this->valid(); $this->next()) {
            $data[] = $this->current();
        }

        return $data;
    }
public function toArray ( ) { $ data = [ ] ; for ( $ this -> rewind ( ) ; $ this -> valid ( ) ; $ this -> next ( ) ) { $ data [ ] = $ this -> current ( ) ; } return $ data ; }
Convert the iterator into an array.

@return array
The elements
Convert the iterator into an array .