Skip to content

Instantly share code, notes, and snippets.

@mchung
Created January 23, 2013 03:07
Show Gist options
  • Save mchung/4601514 to your computer and use it in GitHub Desktop.
Save mchung/4601514 to your computer and use it in GitHub Desktop.
recreating wordpress wp_options
<?php
// from db
echo "from db\n";
$db_value = 'a:1:{i:0;s:19:"heroku-sendgrid.php";}';
echo $db_value;
echo "\n";
var_dump(unserialize($db_value));
echo "\n";
// recreating...
echo "recreating\n";
$db_option = array(
0 => "heroku-sendgrid.php"
);
echo serialize($db_option);
echo "\n";
var_dump($db_option);
?>
@mchung
Copy link
Author

mchung commented Jan 23, 2013

// from db
a:1:{i:0;s:19:"heroku-sendgrid.php";}
array(1) {
  [0]=>
  string(19) "heroku-sendgrid.php"
}

// recreating
a:1:{i:0;s:19:"heroku-sendgrid.php";}
array(1) {
  [0]=>
  string(19) "heroku-sendgrid.php"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment