ຫົວຂໍ້ PHP crc32()

ຕົວຢ່າງ

ການອອກສຽງ crc32() ຜົນການຈັດຕັ້ງ:

<?php
$str = crc32("Shanghai");
printf("睵n",$str);
?>

Run Example

Definition and Usage

The crc32() function calculates the 32-bit CRC (cyclic redundancy check) of a string.

This function can be used to verify data integrity.

Tip:To ensure that the correct string representation is obtained from the crc32() function, you need to use the ꊻmat specifier of the printf() or sprintf() function. If the ꊻmat specifier is not used, the result may be displayed as an incorrect number or a negative number.

Syntax

crc32(string)
Parameter Description
string Required. Specifies the string to be calculated.

Technical Details

Return Value: ກັບຄວາມຈັງສິບສອງຄວາມສະແດງສິບສອງຄວາມຈັງສິບສອງຄວາມສະແດງ
PHP Version: 4.0.1+

ກໍລະນີ 1

ໃນການຕັ້ງຄວາມຄືນນີ້,ພວກເຮົາຈະອອກພາກສ່ວນ crc32() ທີ່ໃຊ້ ແລະ ບໍ່ໃຊ້ "眻 ຂອງຂະແນນສະແດງ (ສັງເກດວ່າຄວາມອອກຈະເປັນດຽວ):

<?php
$str = crc32("Hello world!");
echo 'Without ៷$str."<br>";
echo 'With ᠄
printf("眻,$str);
?>

ຄວາມອອກຂອງວິກາຊາດຂັ້ນຖານຫນັງຂອງວິກາຊາດຂັ້ນຖານຫນັງຂອງວິກາຊາດຂັ້ນຖານຫນັງວິກາຊາດຂັ້ນຖານຫນັງ

Without ᥆1707669
With ᥆1707669

ກໍລະນີ 2

ໃນການຕັ້ງຄວາມຄືນນີ້,ພວກເຮົາຈະອອກພາກສ່ວນ crc32() ທີ່ໃຊ້ ແລະ ບໍ່ໃຊ້ "眻 ຂອງຂະແນນສະແດງ (ສັງເກດວ່າຄວາມອອກຈະບໍ່ແມ່ນດຽວ):

<?php
$str = crc32("Hello world.");
echo 'Without ៷$str."<br>";
echo 'With ᠄
printf("眻,$str);
?>

ຄວາມອອກຂອງວິກາຊາດຂັ້ນຖານຫນັງຂອງວິກາຊາດຂັ້ນຖານຫນັງຂອງວິກາຊາດຂັ້ນຖານຫນັງວິກາຊາດຂັ້ນຖານຫນັງ

Without ᡡ959132156
With ᤣ35835140