[drupal-devel] OT: Binary data.

Steven Wittens steven at acko.net
Wed Mar 16 00:30:13 UTC 2005


What about:

$string = chr($num >> 24) . chr(($num >> 16) & 0xFF) . chr(($num >> 8) & 
0xFF) . chr($num & 0xFF);
(big endian)

Depending on how chr works, you might even get away with removing the & 
0xFF.

Steven Wittens



More information about the drupal-devel mailing list