F.37. Strings

FunctionReturnsDescription
crc32(string str)
stringCalculates the crc32 polynomial of a string.
crypt(string str [, string salt])
stringEncrypts a string.
convert_cyr_string(string str, string from, string to)
stringConverts from one Cyrillic character set to another.
lcg_value()
floatReturns a value from the combined linear congruential generator.
levenshtein(string str1, string str2)
intCalculates Levenshtein distance between two strings.
md5(string str, [ bool raw_output])
stringCalculates the md5 hash of a string.
md5_file(string filename [, bool raw_output])
stringCalculates the md5 hash of given filename.
metaphone(string text, int phones)
stringBreaks English phrases down into their phonemes.
pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])
stringTakes one or more arguments and packs them into a binary string according to the format argument.
unpack(string format, string input)
arrayUnpacks binary string into named array elements according to format argument.
sha1(string str [, bool raw_output])
stringCalculates the sha1 hash of a string.
sha1_file(string filename [, bool raw_output])
stringCalculates the sha1 hash of given filename.
soundex(string str)
stringCalculates the soundex key of a string.
bin2hex(string data)
stringConverts the binary representation of data to hex.
strspn(string str, string mask [, start [, len]])
intFinds length of initial segment consisting entirely of characters found in mask. If start and/or length is provided, works ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.