Possible duplicate:
pack () in php. Hexadecimal Warning
I use the apple push notification service, and to send a notification, you need to create the message in binary format. I got the following errors for the line below:
Warning: pack (): Type H: illegal hexadecimal digit r
Warning: pack (): Type H: illegal hexadecimal digit y
Note. Converting an array to a string in C: \ xampp \ htdocs \ firecom \ FireComAPNS.php on line 130
Here's the line of code that throws an error:
$msg = chr(0).pack('n', 32).pack('H*', $devicetoken).pack('n',strlen($payload)) . $payload;
and
$devicetoken=773f5436825a7115417d3d1e036da20e806efeef547b7c3fe4da724d97c01b30
I searched the Internet many times, but I have no idea how to mess around with binary code, any help on what happens will be greatly appreciated!
Jon Erickson
source share