Created
September 28, 2019 16:04
-
-
Save kodie/e7c3b93645b02071c638914ecae5c39a to your computer and use it in GitHub Desktop.
Adds double quotes back to a serialized string after they have been removed and then unserializes it to return an 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
<?php | |
$str = unserialize(str_replace('s:0:;', 's:0:"";', preg_replace('/(.*?)(s:\d+:)([^{};]*?)([;}]+)/', '$1$2"$3"$4', $str))); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment