I need to convert the following perl function to php:
pack(\"SSA12AC4L\", $id, $loc, $name, \'ar\', split(/\\./, $get->getIP), t
The problem is that php preg_split is converting it to an array. You need an unsigned char, so use
$x = intval(implode("", preg_split('/\./','10.2.1.1', -1, PREG_SPLIT_NO_EMPTY))); echo pack('SSA12ACL', '25', '00001', '2u7wx6fd94fd', 'f', $x, time()+(60*60));
Let know how it goes.