本文整理汇总了PHP中PHPExcel_Writer_Excel5_BIFFwriter::byteOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Writer_Excel5_BIFFwriter::byteOrder方法的具体用法?PHP PHPExcel_Writer_Excel5_BIFFwriter::byteOrder怎么用?PHP PHPExcel_Writer_Excel5_BIFFwriter::byteOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Writer_Excel5_BIFFwriter
的用法示例。
在下文中一共展示了PHPExcel_Writer_Excel5_BIFFwriter::byteOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getByteOrder
/**
* Determine the byte order and store it as class data to avoid
* recalculating it for each call to new().
*
* @return int
*/
public static function getByteOrder()
{
if (!isset(self::$byteOrder)) {
// Check if "pack" gives the required IEEE 64bit float
$teststr = pack("d", 1.2345);
$number = pack("C8", 0x8d, 0x97, 0x6e, 0x12, 0x83, 0xc0, 0xf3, 0x3f);
if ($number == $teststr) {
$byte_order = 0;
// Little Endian
} elseif ($number == strrev($teststr)) {
$byte_order = 1;
// Big Endian
} else {
// Give up. I'll fix this in a later version.
throw new PHPExcel_Writer_Exception("Required floating point format not supported on this platform.");
}
self::$byteOrder = $byte_order;
}
return self::$byteOrder;
}