Created
January 6, 2023 11:25
-
-
Save kaskad88/c14c0d756c51d20ee0ee3c060f9f2deb to your computer and use it in GitHub Desktop.
Recalculating the length of the elements in serialized array
This file contains 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
$data = preg_replace_callback('!s:\d+:"(.*?)";!s', | |
function($m) { | |
return "s:" . strlen($m[1]) . ':"'.$m[1].'";'; | |
}, $data | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment