>= 8; } while ($carry > 0) { $bytes[] = $carry & 0xff; $carry >>= 8; } } for ($position = 0; $position < $length - 1 && $value[$position] === '1'; $position++) { $bytes[] = 0; } $decoded = ''; for ($index = count($bytes) - 1; $index >= 0; $index--) { $decoded .= chr($bytes[$index]); } return $decoded; } }