Skip to content

Instantly share code, notes, and snippets.

@lcherone

lcherone/file.php

Last active Jan 2, 2021
Embed
What would you like to do?
manual wordpress serialize fixer
<?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