PHPackages                             sbsedv/input-converter - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. sbsedv/input-converter

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

sbsedv/input-converter
======================

A minimal PHP library to nativly support PUT, PATCH and DELETE user input in form of mutlipart/form-data, application/x-www-form-urlencoded and various JSON types like application/json with complex data structures (nested html forms).

v3.0.0(3y ago)114111MITPHPPHP &gt;=8.1

Since Dec 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/SBSEDV/input-converter-php)[ Packagist](https://packagist.org/packages/sbsedv/input-converter)[ RSS](/packages/sbsedv-input-converter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (1)

[![PHPUnit](https://github.com/SBSEDV/input-converter-php/actions/workflows/phpunit.yml/badge.svg)](https://github.com/SBSEDV/input-converter-php/actions/workflows/phpunit.yml)[![PHPStan](https://github.com/SBSEDV/input-converter-php/actions/workflows/phpstan.yml/badge.svg)](https://github.com/SBSEDV/input-converter-php/actions/workflows/phpstan.yml)[![PHPCS-Fixer](https://github.com/SBSEDV/input-converter-php/actions/workflows/phpcsfixer.yml/badge.svg)](https://github.com/SBSEDV/input-converter-php/actions/workflows/phpcsfixer.yml)

sbsedv/input-converter
======================

[](#sbsedvinput-converter)

A minimal PHP component to nativly support user input parsing on http methods other than POST.

PHP natively only supports the parsing of multipart/form-data and application/x-www-form-urlencoded on POST http requests.

Many modern web applications also want use / support a) other http methods like PUT or PATCH and b) other content encodings like JSON or XML.

This component provides a very simple and extensible object oriented api to support just that.

Internally this component uses the PHP native functions [json\_decode](https://www.php.net/manual/en/function.json-decode) and [parse\_str](https://www.php.net/manual/en/function.parse-str) (multpart/form-data gets "translated" to x-www-form-urlencoded) and therefore complex data structures (arrays and objects) are only limited by what those functions support.
This effectifly means that HTMLForms like the following are `FULLY supported`.

```

        ...

        ...

```

---

**How it Works**
----------------

[](#how-it-works)

You should instantiate and call this component as early in your app lifecycle as possible.

You **MUST** either pass a [PSR-7](https://www.php-fig.org/psr/psr-7/) or [HTTP-Foundation](https://symfony.com/doc/current/components/http_foundation.html) request wrapper object to the "convert" method.

```
