For those who want a more familiar return value for the function:
<?php
function strcrc32($text) {
$crc = crc32($text);
if ($crc & 0x80000000) {
$crc ^= 0xffffffff;
$crc += 1;
$crc = -$crc;
}
return $crc;
}
?>
And to show the result in Hex string:
<?php
function int32_to_hex($value) {
$value &= 0xffffffff;
return str_pad(strtoupper(dechex($value)), 8, "0", STR_PAD_LEFT);
}
?>