Last active
January 2, 2021 20:20
-
-
Save lcherone/6446ee12eec32180c0300071a6e252e1 to your computer and use it in GitHub Desktop.
manual wordpress serialize fixer
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 = 'a:1:{s:3:"foo";s:23:"https://beta.domain.com";}'; | |
echo serialize(json_decode(str_replace('beta.domain.com', 'domain.com', json_encode(unserialize($str))), true)); | |
// a:1:{s:3:"foo";s:18:"https://domain.com";} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment