Skip to content

Instantly share code, notes, and snippets.

@UltimateByte
Created October 3, 2023 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UltimateByte/cf6ba0e44328ea1ef20899647cc091e6 to your computer and use it in GitHub Desktop.
Save UltimateByte/cf6ba0e44328ea1ef20899647cc091e6 to your computer and use it in GitHub Desktop.
Unserialize Data (WordPress)
<?php
// Your serialized data
$option_value = 'a:100:[...]';
$data = unserialize($option_value);
// Data to replace directly within variable
$data['footer_text'] = '<a href="https://www.lrob.fr">Webmaster lrob.fr</a>';
// We serilize data back
$new_option_value = serialize($data);
// And output for later use (phpMyAdmin or else)
echo "new serialized data: " . $new_option_value . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment