PHP crc32()函数讲解
来源:懂视网
责编:小采
时间:2020-11-27 14:43:36
PHP crc32()函数讲解
PHP crc32()函数讲解:PHP crc32() 函数 实例 输出 crc32() 的结果: <?php $str = crc32(Hello World!); printf(%un,$str); ?> 定义和用法 crc32()函数计算一个字符串的 32 位 CRC(循环冗余校验)。 该函数可用于验证数据的完整性。 提示: 为确
导读PHP crc32()函数讲解:PHP crc32() 函数 实例 输出 crc32() 的结果: <?php $str = crc32(Hello World!); printf(%un,$str); ?> 定义和用法 crc32()函数计算一个字符串的 32 位 CRC(循环冗余校验)。 该函数可用于验证数据的完整性。 提示: 为确

实例 2
在本实例中,我们将在使用以及不使用 "%u" 格式符的情况下,输出 crc32() 的结果(注意结果是不相同的):
<?php
$str = crc32("Hello world.");
echo 'Without %u: '.$str."<br>";
echo 'With %u: ';
printf("%u",$str);
?>
上面的代码将输出:
Without %u: -1959132156
With %u: 2335835140
总结
PHP crc32()函数讲解
PHP crc32()函数讲解:PHP crc32() 函数 实例 输出 crc32() 的结果: <?php $str = crc32(Hello World!); printf(%un,$str); ?> 定义和用法 crc32()函数计算一个字符串的 32 位 CRC(循环冗余校验)。 该函数可用于验证数据的完整性。 提示: 为确