diff options
| author | Hideyuki TAKEI <takehide22@gmail.com> | 2010-04-05 00:10:28 +0900 |
|---|---|---|
| committer | Hideyuki TAKEI <takehide22@gmail.com> | 2010-04-05 00:10:28 +0900 |
| commit | 99a2d2859269ddf803a802c043babcd977260faf (patch) | |
| tree | 5d0a89a77fab9f3c81dbcf49ef5696ef6d3b1f26 /php/test_normal.php | |
| parent | 254ee80c16b3b0ce12b461d189aa1e6302debea0 (diff) | |
| download | msgpack-python-99a2d2859269ddf803a802c043babcd977260faf.tar.gz | |
import MessagePack for PHP
Diffstat (limited to 'php/test_normal.php')
| -rwxr-xr-x | php/test_normal.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/php/test_normal.php b/php/test_normal.php new file mode 100755 index 0000000..ee348c2 --- /dev/null +++ b/php/test_normal.php @@ -0,0 +1,19 @@ +<?php + //$data = array(array(null=>1), array("takei"=>"hide"), 3); + //$data = array("more"=>10, "test", null); + //$data = array(); + $data = array(0=>1,1=>2,2=>3); + var_dump($data); + + // serialize + $msg = msgpack_pack($data); + + // hexadecimal + $str = unpack('H*', $msg); + var_dump("0x".$str[1]); + + // deserialize + $ret = msgpack_unpack($msg); + var_dump($ret); +?> + |
