Convert python pack to php pack

nixi35

New Member
I have this python script\[code\]b_string = pack('>hqh2sh13sh5sh3sBiiihiiiiii', 21, 0, len(country), country, len(device), device, len('1.3.1'), "1.3.1", len('Web'), "Web", 27, 0, 0, 3, 0, cid, lac, 0, 0, 0, 0)\[/code\]and I want to convert it to php, this is what I came with so far\[code\]$body= pack('nln2c*n13c*n5c*n3c*Ciiiniiiiii', 21, 0, strlen($this->_mccToCountry[$this->_mcc]), $this->_mccToCountry[$this->_mcc], strlen($this->_device), $this->_device, strlen('1.3.1'), "1.3.1", strlen('Web'), "Web", 27, 0, 0, 3, 0, $this->_cellId, $this->_lac, 0, 0, 0, 0);\[/code\]The variables are same as those in python script, but i got this errorPHP Warning: pack(): Type n: too few arguments in .../application/extensions/Zend-extensions/NMS/Bts.php:150The help will be very appreciated.
 
Back
Top