I need to pack() data in PHP according to a typedef'ed C format structure, but there seems to be two problems (as per the docs: http://ca.php.net/manual/en/function.pack.php).

First, in PHP there is no format option for "long signed integers, big-endian byte order", just "signed long (always 32 bit, machine byte order)". Or am I missing something?

Second—and I guess this is not a problem with PHP per se, just a question of interpretation—the client specifications call for a certain 10-digit string to be packed as char (" char[10] "). But "char" is just a single character right? Or do you think the docs essentially mean packing it as an alpha? (Whose length can be specified.)

$str = "1234567890";
$packed = pack("a10string",$str);

...Rene
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to