Home > Backend Development > PHP Tutorial > What are the php string functions?

What are the php string functions?

藏色散人
Release: 2023-04-06 21:26:01
Original
2767 people have browsed it

What are the php string functions?

What are the string functions in php?

php string functions:

addcslashes — Escape characters in a string using backslashes in C style

addslashes — Use backslashes to quote strings

bin2hex — Function converts a binary string containing data to a hexadecimal value

chop — Alias ​​for rtrim

chr — Returns the specified character

chunk_split — Split a string into small chunks

convert_cyr_string — Convert a character from one Cyrillic character to another

convert_uudecode — Decode a uuencode Encoded string

convert_uuencode — Encode a string using uuencode

count_chars — Return information about the characters used in the string

crc32 — Calculate the crc32 polynomial of a string

crypt — One-way string hashing

echo — Output one or more strings

explode — Use one string to split another string

fprintf — Write the formatted string to the stream

get_html_translation_table — Return the translation table using htmlspecialchars and htmlentities

hebrev — Convert logical-Hebrew Convert to visual-Hebrew

hebrevc — Convert logical-Hebrew to visual-Hebrew, and convert newlines Symbol

hex2bin — Convert hexadecimal string to binary string

html_entity_decode — Convert HTML entities to their corresponding characters

htmlentities — Convert characters to HTML escaping Characters

htmlspecialchars_decode — Convert special HTML entities back to normal characters

htmlspecialchars — Convert special characters to HTML entities

implode — Convert the value of a one-dimensional array to string

join — alias implode

lcfirst — Make the first character of a string lowercase

levenshtein — Calculate the edit distance between two strings

localeconv — Get numeric formatting information

ltrim — Remove blank characters (or other characters) at the beginning of a string

md5_file — Calculate the MD5 hash value of the specified file

md5 — Calculate the MD5 hash value of a string

metaphone — Calculate the metaphone key of a string

money_format — Format a number into a currency string

nl_langinfo — Query language and locale information

nl2br — Insert an HTML line break before all new lines in a string

number_format — Format a number with thousands separators

ord — Convert the first byte of the string to a value between 0-255

parse_str — Parse the string into multiple variables

print — Output the string

printf — Output formatted string

quoted_printable_decode — Convert quoted-printable string to 8-bit string

quoted_printable_encode — Convert 8-bit string to quoted-printable string

quotemeta — Escape metacharacter set

rtrim — Remove blank characters (or other characters) at the end of the string

setlocale — Set locale information

sha1_file — Calculate the sha1 hash value of a file

sha1 — Calculate the sha1 hash value of a string

similar_text — Calculate the similarity of two strings

soundex — Calculate the soundex key of a string

sprintf — Return a formatted string

sscanf — Parse the input characters according to the specified format

str_getcsv — Parse the CSV string into an array

str_ireplace — A case-ignoring version of str_replace

str_pad — Pad a string to a specified length with another string

str_repeat — Repeat a string

str_replace — Sub String replacement

str_rot13 — Perform ROT13 transformation on a string

str_shuffle — Randomly shuffle a string

str_split — Convert a string to an array

str_word_count — Returns the usage of words in a string

strcasecmp — Binary-safe comparison of strings (case-insensitive)

strchr — Alias ​​strstr

strcmp — Binary-safe String comparison

strcoll — Locale-based string comparison

strcspn — Get the length of the starting substring of a non-matching mask

strip_tags — From a string Strip HTML and PHP tags from

stripcslashes — Dequote a string escaped using addcslashes

stripos — Find the first occurrence of a string (case-insensitive)

stripslashes — Dequote a quoted string

stristr — A case-ignoring version of the strstr function

strlen — Get the length of a string

strnatcasecmp — Use the “natural order” algorithm Compare strings (case-insensitive)

strnatcmp — Compare strings using the natural ordering algorithm

strncasecmp — Binary-safe comparison of several characters at the beginning of a string (case-insensitive)

strncmp — Binary safe comparison of several characters at the beginning of a string

strpbrk — Find any character in a set of characters in a string

strpos — Find the first occurrence of a string

strrchr — Find the last occurrence of a specified character in a string

strrev — Reverse a string

strripos — Calculate the position of the last occurrence of the specified string in the target string (case-insensitive)

strrpos — Calculate the position of the last occurrence of the specified string in the target string

strspn — Calculate the length of the first substring in a string in which all characters exist in the specified character set.

strstr — Find the first occurrence of a string

strtok — Mark split string

strtolower — Convert a string to lowercase

strtoupper — Convert a character Convert string to uppercase

strtr — Convert the specified character

substr_compare — Binary safe comparison of strings (compare specified length from offset position)

substr_count — Count occurrences of a string Times

substr_replace — Replace the substring of the string

substr — Return the substring of the string

trim — Remove the blank characters (or other characters) at the beginning and end of the string

ucfirst — Converts the first letter of a string to uppercase

ucwords — Converts the first letter of each word in a string to uppercase

vfprintf — Converts formatting characters String writing stream

vprintf — Output a formatted string

vsprintf — Return a formatted string

wordwrap — Break the string into a specified number of words

Related recommendations: "PHP Tutorial"

The above is the detailed content of What are the php string functions?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template