export to multi dimensional array
@param integer $sheet
@return array
510514
public function toArray($sheet = 0)
    {
        $arr = array();
        for ($row = 1; $row <= $this->rowcount($sheet); $row++) {
            for ($col = 1; $col <= $this->colcount($sheet); $col++) {
                $arr[$row][$col] = $this->val($row, $col, $sheet);
            }
        }

        return $arr;
    }
1142036
public static function export($data)
    {
        if (is_object($data)) {
            //	Allow embedded export method for specific export
            if ($data instanceof Arrayable || method_exists($data, 'toArray')) {
                $data = $data->toArray();
            } else {
                $data = get_object_vars($data);
            }
        }

        if (!is_array($data)) {
            return $data;
        }

        $output = [];

        foreach ($data as $key => $value) {
            $output[$key] = static::export($value);
        }

        return $output;
    }
1214744
public function export()
	{
		$result = [];
		foreach ($this->getListBuilder()->getResult() as $item) {
			foreach ($item->getFields() as $field) {
				$value = $field->getValue();

				if (!is_string($value)) {
					$value = $value->toArray();
				}

				$result[$item->getIdentifier()][$field->getName()] = $value;
			}
		}

		\Excel::create($this->getFilename(), function($excel) use ($result) {
			$excel->setTitle('Export');
			$excel->setCreator('Bauhaus')
				->setCompany('KraftHaus');

			$excel->sheet('Excel sheet', function($sheet) use ($result) {
				$sheet->setOrientation('landscape');
				$sheet->fromArray($result);
			});

		})->download('xls');
	}
454336
public function export()
    {
        $rows = [];
        foreach ($this->messages as $message) {
            list($text, $level, $category, $timestamp) = $message;
            if (!is_string($text)) {
                // exceptions may not be serializable if in the call stack somewhere is a Closure
                if ($text instanceof \Throwable || $text instanceof \Exception) {
                    $text = (string) $text;
                } else {
                    $text = VarDumper::export($text);
                }
            }
            $rows[] = [
                'level' => $level,
                'category' => $category,
                'log_time' => $timestamp,
                'prefix' => $this->getMessagePrefix($message),
                'message' => $text,
            ];
        }

        $this->db->getCollection($this->logCollection)->batchInsert($rows);
    }
440408
public function export($options = [])
    {
        $this->_setContentLength();

        return [
            'method'   => $this->method(),
            'scheme'   => $this->scheme(),
            'version'  => $this->version(),
            'hostname' => $this->hostname(),
            'port'     => $this->port(),
            'path'     => $this->path(),
            'query'    => $this->query() ? '?' . http_build_query($this->query()) : '',
            'fragment' => $this->fragment(),
            'username' => $this->username(),
            'password' => $this->password(),
            'url'      => $this->url()
        ];
    }
495385
public function toArray($sheet_name,$ext=false)
  {
    if(!$ext){
      $ext=pathinfo($sheet_name, PATHINFO_EXTENSION);
    }
    switch ($ext) {
      case 'csv':
      $reader = ReaderFactory::create(Type::CSV);
      break;
      case 'ods':
      $reader = ReaderFactory::create(Type::ODS);
      break;
      case 'xlsx':
      $reader = ReaderFactory::create(Type::XLSX);
      break;
    }
    $reader->open($sheet_name);
    foreach ($reader->getSheetIterator() as $sheet) {
      $sheetName = $sheet->getName();
      foreach ($sheet->getRowIterator() as $row) {
        $list['lists'][$sheetName][]=$row;
      }
    }
    $reader->close();
    $lists=false;
    foreach ($list['lists'] as $key => $value) {
      $lists[$key]=$this->sheetToAlpha($value);
    }
    if($ext=="csv"){
      return $lists[""];
    }else{
      return $lists;
    }
  }
1271974
public function exportByHandle(string $handle): array
    {
        $field = Craft::$app->fields->getFieldByHandle($handle);
        return $this->export($field);
    }
894768
protected function getCellStylesArray(Cell $cell)
    {
        $styles = $this->getStylesArray($cell);

        if ($cell->isHeader()) {
            $styles['font']['bold'] = true;
        }

        return $styles;
    }
981694
public function toArray($simplify = false): array
    {
        $r = [];
        foreach ($this as $key => $val) {
            $r[$key] = $val;
        }
        if ($simplify) {
            $r = array_filter($r);
        }

        return $r;
    }
794914
public function toArray()
    {
        $ref = new \ReflectionObject($this);
        $export = array();

        foreach ($ref->getProperties() as $property) {
            $property->setAccessible(true);
            $name = strtolower(
                preg_replace('@([A-Z])@', '_\1', $property->getName())
            );
            $export[$name] = $property->getValue($this);

            if ($export[$name] instanceof DataWrapperInterface) {
                $export[$name] = $export[$name]->toArray();
            } elseif ($export[$name] instanceof \DateTime) {
                $export[$name] = $export[$name]->format('Y-m-d');
            }
        }

        return $export;
    }
688712
public static function extract(Worksheet $worksheet, $importable): array
    {
        if (!$importable instanceof WithHeadingRow) {
            return [];
        }

        $headingRowNumber = self::headingRow($importable);
        $rows             = iterator_to_array($worksheet->getRowIterator($headingRowNumber, $headingRowNumber));
        $headingRow       = head($rows);

        return HeadingRowFormatter::format((new Row($headingRow))->toArray(null, false, false));
    }
1234116
public function export($table) {

		$table = config('center.tables.' . $table);
		if (empty($table->export)) return false; //throw new exception?

		Excel::create($table->title, function($excel) use ($table) {

		    $excel->setTitle($table->title)->sheet($table->title, function($sheet) use ($table) {
		
					//fetch data
					$results = DB::table($table->name);
					foreach ($table->order_by as $column=>$direction) {
						$results->orderBy($column, $direction);
					}
					$results = $results->get();

					//output array
					$rows = [];
					
					foreach ($results as $result) {
						$row = [];
						foreach ($table->export as $field) {
							$row[trans('center::' . $table->name . '.fields.' . $field)] = $result->{$field};
						}
						$rows[] = $row;
					}
					
					/*format columns
					$sheet->setColumnFormat([
						'E' => '0.00',
					]);*/

					$sheet->with($rows)->freezeFirstRow()->row(1, function ($row) {
			            $row->setFontWeight('bold');
			            $row->setBackground('#FFFFEE');
						$row->setBorder('none', 'none', 'bottom', 'none');
			        })->setHeight(1, 30);
					
					/*
					$sheet->cells('A1:F1', function($cells) {
						$cells->setFontWeight('bold');
					});*/

				});

		})->download('xlsx');
	}
1068154
public function toArray()
    {
        $array = [];

        foreach ($this->items as $key => $value) {
            if ($value instanceof ExportableInterface) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
43016
function export() {
		$export = array_merge($this->data, $this->cell);
		foreach ($export as &$val) {
			if ($val instanceof Cell) {
				if ($val->isExpr()) {
					throw new \UnexpectedValueException("Cannot export an SQL expression");
				}
				$val = $val->get();
			}
		}
		return $export;
	}
556618
public function export()
    {
        return array(
            self::COLUMNS => $this->getArrayCopy(),
            self::METADATA => $this->metadata,
            self::DATATABLE_ASSOCIATED => $this->subtableId,
        );
    }
1050638
def sheets(self, index=None):
    """"""
    if self._sheets is None:
      self._sheets = [self.get_worksheet(s, i) for i, s in enumerate(self.iterate_sheets())]
    if index is None:
      return self._sheets
    else:
      return self._sheets[index]
543196
public function export($lang = null)
    {
        $lang = $lang ? $this->lang($lang) : $this->default;

        if (!isset($this->imported[$lang])) {
            return [];
        }

        return $this->imported[$lang];
    }