- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
crc32() function in PHP
The crc32() function is used to calculate 32-bit CRC. You can use the function to validate data integrity.
Syntax
crc32(str)
Parameters
str − The string
Return
The crc32() function returns the crc32 checksum of string as an integer.
Example
The following is an example −
<?php $res = crc32("This is demo text!"); printf("%u
", $res); ?>
Output
2903462745
Example
Let us see another example −
<?php $s = crc32("Welcome!"); echo 'First:'.$s."
"; printf("Second: %u
", $s); ?>
Output
First: 893564114 Second: 893564114
Advertisements