PHP 字符串函数是 PHP 核心的组成部分。
最常用函数:
- substr
- substr_compare
- substr_count
- substr_replace
- trim
- ucfirst
- ucwords
- strlen
- strcmp
- echo
- explode
- join
- ltrim
- md5
- ord
- printf
- rtrim
- addslashes
- strtolower
- strtoupper
- strrev
- strstr
- strpos
- str_replace
- str_repeat
- str_shuffle
- str_split
- strcasecmp
- strchr strstr的别名
- strcmp
- addcslashes
- chop
- chr
- crc32
- crypt
- nl2br
- parse_str
- htmlspecialchars
- implode
- strip_tags
- stripcslashes
- stripslashes
- str_pad
- str_ireplace
- htmlentities
比较:
- strcoll
- strnatcasecmp
- strnatcmp
- strncasecmp
- strncmp
格式化:
- fprintf
- money_format
- number_format
- sprintf
- vfprintf
- vprintf
- vsprintf
编码:
- convert_uudecode
- convert_uuencode
- str_rot13
查找:
- strcspn
- stristr
- strpbrk
- stripos
- strrchr
- strripos
- strrpos
其他:
- bin2hex
- chunk_split
- convert_cyr_string
- count_chars
- get_html_translation_table
- hebrev
- hebrevc
- hex2bin
- html_entity_decode
- htmlspecialchars_decode
- lcfirst
- levenshtein
- localeconv
- md5_file
- metaphone
- nl_langinfo
- quoted_printable_decode
- quoted_printable_encode
- quotemeta
- setlocale
- sha1
- sha1_file
- similar_text
- soundex
- sscanf
- str_getcsv
- str_word_count
- strspn
- strtok
- strtr