/** * Returns a sequence of bytes in big endian order, it orders the string depending * on machine architecture (big endian or little endian).<BR> * * Based in code from Open Sound Control (OSC) Client Library for PHP<BR> * Author: Andy W Schmeder <andy@a2hd.com><BR> * Copyright 2003 * * @param string string sequence of bytes to order * @return string big endian ordered sequence of bytes * @access public **/ function orderedByteString($string) { if (Hessian_ByteUtils::isLittleEndian()) { $orderStr = ''; for ($i = 0; $i < strlen($string); $i++) { $index = strlen($string) - 1 - $i; $orderStr .= $string[$index]; } return $orderStr; } // No conversion necessary for big-endian architecture return $string; }