PHP crc32() Function
In this chapter you will learn:
- Description for PHP crc32() Function
- Syntax for PHP crc32() Function
- Parameter for PHP crc32() Function
- Example for PHP crc32(string)
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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP crypt() Function
- Syntax for PHP crypt() Function
- Parameter for PHP crypt() Function
- Return for PHP crypt() Function
- Note for PHP crypt() Function
- Example - encrypt password
- Example - Using crypt() with htpasswd
- Example - Using crypt() with different hash types
Home » PHP Tutorial » PHP String Functions