<?php
$command = 1;
$chksum = 2;
$session_id = 3;
$reply_id = 4;
$command_string = 'test';
$buf = pack('SSSS', $command, $chksum, $session_id, $reply_id).$command_string;
$buf = unpack('C'.(8+strlen($command_string)).'c', $buf);
var_dump($buf);
- Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- array(12) {
["c1"]=>
int(1)
["c2"]=>
int(0)
["c3"]=>
int(2)
["c4"]=>
int(0)
["c5"]=>
int(3)
["c6"]=>
int(0)
["c7"]=>
int(4)
["c8"]=>
int(0)
["c9"]=>
int(116)
["c10"]=>
int(101)
["c11"]=>
int(115)
["c12"]=>
int(116)
}
preferences:
221.74 ms | 404 KiB | 208 Q