mikegarde/unserialize-fix

PHP Unserialize Fixer

0.1.01 2016-07-06 21:25 UTC

This package is auto-updated.

Last update: 2024-04-15 00:57:45 UTC


README

PHP Unserialize Fixer

The best way to use serialize is to use json_encode, but when the guy before you used serialize use this unserialize instead.

$string = json_encode($array);
$array  = json_decode($string);

Install

composer require "mikegarde/unserialize-fix:0.1.*"

No need to "use" if you are already including "autoload.php"

require __DIR__ . '/../vendor/autoload.php';

$fixed = \unserialize\fix($string);

Notes

I through this together so that I could work on some old logs and it is not 100% however was able to unserialize my logs. When time allows I will finish this project which will probably include new names so make sure you stick to 0.1.* and check here before upgrading to 0.2