周梦康 发表于 2017-10-28 2098 次浏览 标签 : php

https://mengkang.net/586.html

$a = 123;
$b = 456;
$c = 789;
$str = pack('N3',$a,$b,$c);
var_dump(unpack('N*',$str));
var_dump(unpack('Na/Nb/Nc',$str));

输出结果

array(3) {
  [1] =>
  int(123)
  [2] =>
  int(456)
  [3] =>
  int(789)
}
array(3) {
  'a' =>
  int(123)
  'b' =>
  int(456)
  'c' =>
  int(789)
}

评论列表