PHPackages                             tvanc/files-array-organizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tvanc/files-array-organizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tvanc/files-array-organizer
===========================

Creates an organized version of the $\_FILES array.

2.0.1(5y ago)32981[1 PRs](https://github.com/tvanc/files-array-organizer/pulls)mitPHPPHP ^7.3CI failing

Since Mar 7Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/tvanc/files-array-organizer)[ Packagist](https://packagist.org/packages/tvanc/files-array-organizer)[ RSS](/packages/tvanc-files-array-organizer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (1)Versions (6)Used By (0)

Files Array Organizer
=====================

[](#files-array-organizer)

[![Build status](https://camo.githubusercontent.com/5dbf0030bb96570d5086d71ca9a24eebf287cbdbb8ffe8b6005f22a7de4d1719/68747470733a2f2f7472617669732d63692e6f72672f7476616e632f66696c65732d61727261792d6f7267616e697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tvanc/files-array-organizer.svg)[![codecov](https://camo.githubusercontent.com/6153fbabd4a3ff7714e137bfa0ddb057b24f909e5f0b3f9ed226cc7186cb430a/68747470733a2f2f636f6465636f762e696f2f67682f7476616e632f66696c65732d61727261792d6f7267616e697a65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/tvanc/files-array-organizer)

[Getting Started](#getting-started)[Examples](#examples)[Explanation](#explanation)Dealing with the `$_FILES` array in PHP sucks. Most solutions only work for a specific situation and aren't easily portable. This utility is designed to organize any possible incarnation of the `$_FILES` array into the structure you would intuitively expect. Getting data about uploaded files should be just as easy as reading the `$_POST` array.

Getting Started
---------------

[](#getting-started)

### Requirements

[](#requirements)

PHP &gt;= 7.3

### Installation

[](#installation)

```
composer require tvanc/files-array-organizer
```

Examples
--------

[](#examples)

### One input, one file

[](#one-input-one-file)

In a case like this, the `$_FILES` array is pretty straight forward and the organized version is identical to the unorganized version.

```

    Submit

```

### Multiple inputs that accept multiple files

[](#multiple-inputs-that-accept-multiple-files)

`FilesArrayOrganizer` makes dealing with this less-common scenario *much* easier. Check the [Explanation](#explanation) to see the surprising `$_FILES` array you can get from a form containing multiple inputs that each accept multiple files.

```

        Attachments for todo
