PHP crc32() Function

Description

The crc32() function calculates a 32-bit CRC (cyclic redundancy checksum) for a string.

Syntax

PHP crc32() Function has the following syntax.

crc32(string)

Parameter

string is the value we want to convert.

Example

The following code prints the result of crc32().


<?php
$str = crc32("java2s.com");
printf("%u\n",$str);
?>

We have to use %u to format the result.

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions