論壇:laravel-workerman.iwnweb.com/d/11-...
pack 文件:www.php.net/manual/en/function.pac...
unpack 文件:www.php.net/manual/en/function.unp...
PHP中pack、unpack的詳細用法:segmentfault.com/a/119000000830557...
線上示例:sandbox.onlinephpfunctions.com/c/5...
<?php
$encodeFormat = 'a6N';
$decodeFormat = 'a6random_str/Ntimestamp';
$data = [
uniqid(),
time()
];
$res = pack($encodeFormat, ...$data);
$encode = base64_encode($res);
var_dump($encode);
$data = unpack($decodeFormat, base64_decode($encode));
var_dump($data);
本作品採用《CC 協議》,轉載必須註明作者和本文連結