An open API service indexing awesome lists of open source software.

https://github.com/wizacode/php-error-proof-unserializer

Recover broken php serialized data
https://github.com/wizacode/php-error-proof-unserializer

charset php recover serialize unserialize utf-8

Last synced: 23 days ago
JSON representation

Recover broken php serialized data

Awesome Lists containing this project

README

          

# PHP error proof unserializer

## Intro

```shell
Notice: unserialize(): Error at offset ... of ... bytes ...
```

You can try this to unserialize a corrupted serialized string.

## Usage

```php
use Wizacode\ErrorProofUnserializer\ErrorProofUnserializer;

// Attempt to unserialize a corrupted serialized string:

$recoveredUnserializedData = ErrorProofUnserializer::process($brokenSerializedString);

// Or only fix the serialized string:

$fixedSerializedData = ErrorProofUnserialize::fix($brokenSerializedString);
```

P.S.: Don't record php serialized data in a RDBMS (or use at least a binary safe storage type)