I need to convert the following perl function to php:
pack(\"SSA12AC4L\",
$id,
$loc,
$name,
\'ar\',
split(/\\./, $get->getIP),
t
I think that the problem is that preg_split returns an array. So the array is inserted as the first char, the time as the second, and two chars are left.
I don't know how to fix this problem, but to create a temporary array:
$ip = explode('.','10.2.1.1');
And then:
echo pack("SSA12AC4L",
'25',
'00001',
'2u7wx6fd94fd',
'f',
$ip[0],
$ip[1],
$ip[2]
$ip[3],
time()+(60*60));