Created
August 1, 2020 08:40
-
-
Save tranchausky/ffe1d603af69bd6453cf2970acd32d0c to your computer and use it in GitHub Desktop.
fix unserialize in php, fix PHP: error: Notice: unserialize(): Error at offset 438 of 750 bytes in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $str = preg_replace_callback( | |
| '!s:(\d+):"(.*?)";!', | |
| function($m) { | |
| return 's:'.strlen($m[2]).':"'.$m[2].'";'; | |
| }, | |
| $str); | |
| var_dump(unserialize($str)); | |
| //https://stackoverflow.com/a/48250181 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment