Skip to content

Instantly share code, notes, and snippets.

@heavenshell
Created February 21, 2013 01:49
Show Gist options
  • Save heavenshell/5001278 to your computer and use it in GitHub Desktop.
Save heavenshell/5001278 to your computer and use it in GitHub Desktop.
array(2) {
[1] =>
string(3) "one"
[2] =>
string(3) "two"
}
--------------------
array(2) {
[1] =>
string(3) "one"
[2] =>
string(3) "two"
}
<?php
$data = array('1' => 'one', 2 => 'two');
var_dump($data);
// serialize
$msg = msgpack_pack($data);
echo "--------------------\n";
$msg = msgpack_unpack($msg);
var_dump($msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment