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
- Host: GitHub
- URL: https://github.com/wizacode/php-error-proof-unserializer
- Owner: wizacode
- License: mit
- Created: 2022-05-09T06:54:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-12T20:38:59.000Z (about 4 years ago)
- Last Synced: 2025-12-26T12:11:40.448Z (6 months ago)
- Topics: charset, php, recover, serialize, unserialize, utf-8
- Language: PHP
- Homepage:
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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)