Closed richerdyoung closed 3 years ago
the code
header("Content-type:text/html;charset=utf-8"); $a = ['id'=>1,'name'=>'tt','sex'=>'men']; $msg_a = msgpack_pack($a); $a2 = msgpack_unpack($msg_a); $msg_b = msgpack_serialize($a); $b2 = msgpack_unserialize($msg_b); $result = [ 'msg_a'=>$msg_a, 'a2'=>$a2, 'msg_b'=>$msg_b, 'b2'=>$b2, ]; echo "<pre>"; print_r($result);
thr result
Array ( [msg_a] => ��id�name�tt�sex�men [a2] => Array ( [id] => 1 [name] => tt [sex] => men ) [msg_b] => ��id�name�tt�sex�men [b2] => Array ( [id] => 1 [name] => tt [sex] => men ) )
my project can use this , but out to show the garbled code,
666
msgpack is a binary serialization format, see https://github.com/msgpack/msgpack.
the code
thr result
my project can use this , but out to show the garbled code,