php StringFunction 字符串

StringFunction

 

addslashes — 使用反斜线引用字符串  get_magic_quotes_gpc()

stripslashes — 反引用一个引用字符串

addcslashes — 以 C 语言风格使用反斜线转义字符串中的字符

stripcslashes — 反引用一个使用 addcslashes 转义的字符串

htmlspecialchars — 函数的作用是将字符串中一些字符转换为HTML实体

quotemeta — Quote meta characters.Returns the string with meta characters quoted.

html_entity_decode — Convert all HTML entities to their applicable characters

htmlentities — Convert all applicable characters to HTML entities

htmlspecialchars_decode — Convert special HTML entities back to characters

get_html_translation_table — 返回使用 htmlspecialchars 和 htmlentities 后的转换表

strip_tags — 从字符串中去除 HTML 和 PHP 标记

-----------------------------------------------------------------

bin2hex — 将二进制数据转换成十六进制表示

pack — Pack data into binary string

unpack — Unpack data from binary string

-----------------------------------------------------------------

trim — 去除字符串首尾处的空白字符(或者其他字符)

ltrim — Strip whitespace (or other characters) from the beginning of a string

rtrim() - 删除字符串末端的空白字符(或者其他字符)

chop — rtrim 的别名

-----------------------------------------------------------------

chr — 返回相对应于 ascii 所指定的单个字符

ord — 返回字符的 ASCII 码值

convert_cyr_string — 将字符由一种 Cyrillic 字符转换成另一种

convert_uudecode — 解码一个 uuencode 编码的字符串

convert_uuencode — 使用 uuencode 编码一个字符串

-----------------------------------------------------------------

chunk_split — 将字符串分割成小块

str_split — 将字符串转换为数组 {array str_split ( string $string [, int $split_length = 1 ] ) }

wordwrap — 打断字符串为指定数量的字串 {string wordwrap ( string $str [, int $width = 75 [, string $break = "/n" [, bool $cut = false ]]] )}

strtok — 标记分割字符串 {string strtok ( string $str , string $token )}

explode — 使用一个字符串分割另一个字符串

implode — Join array elements with a string

join — 别名 implode

-----------------------------------------------------------------

split — 用正则表达式将字符串分割到数组中

spliti — 用正则表达式不区分大小写将字符串分割到数组中

preg_split — 用正则表达式分割字符串

-----------------------------------------------------------------

crc32 — 计算一个字符串的 crc32 多项式

crypt — 单向字符串散列

-----------------------------------------------------------------

hebrev — 将逻辑顺序希伯来文(logical-Hebrew)转换为视觉顺序希伯来文(visual-Hebrew)

hebrevc — 将逻辑顺序希伯来文(logical-Hebrew)转换为视觉顺序希伯来文(visual-Hebrew),并且转换换行符

-----------------------------------------------------------------

lcfirst — Make a string's first character lowercase

ucfirst() - 将字符串的首字母转换为大写

ucwords() - 将字符串中每个单词的首字母转换为大写

strtolower() - 将字符串转化为小写

strtoupper() - 将字符串转化为大写

-----------------------------------------------------------------

levenshtein — Calculate Levenshtein distance between two strings

soundex() - Calculate the soundex key of a string

similar_text() - 计算两个字符串的相似度

metaphone() - Calculate the metaphone key of a string

-----------------------------------------------------------------

localeconv — Get numeric formatting information

setlocale - 配置地域化信息

nl_langinfo — Query language and locale information

strcoll — 基于区域设置的字符串比较

-----------------------------------------------------------------

md5_file — 计算指定文件的 MD5 散列值

md5 — 计算字符串的 MD5 散列值

sha1_file — 计算文件的 sha1 散列值

sha1 — 计算字符串的 sha1 散列值

-----------------------------------------------------------------

number_format — Format a number with grouped thousands

money_format() - Formats a number as a currency string

sscanf() - Parses input from a string according to a format

print — 输出字符串

-----------------------------------------------------------------

printf - 输出格式化字符串

sprintf - Return a formatted string

fprintf — 将格式化后的字符串写入到流,返回写入的字符串长度 {int fprintf ( resource $handle , string $format [, mixed $args [, mixed $... ]] )}

vfprintf — 将格式化字符串写入流,返回输出字符串的长度 {int vfprintf ( resource $handle , string $format , array $args )}

vprintf — 打印输出格式化的字符串,并返回字符串长度{int vprintf ( string $format , array $args )}

vsprintf — 返回格式化字符串,sprintf() 函数类似。{string vsprintf ( string $format , array $args )}

echo — 输出一个或多个字符串

======

% 印出百分比符号,不转换。

b 整数转成二进位。

c 整数转成对应的 ASCII 字符。

d 整数转成十进位。

f 倍精确度数字转成浮点数。

o 整数转成八进位。

s 整数转成字符串。

x 整数转成小写十六进位。

X 整数转成大写十六进位。

======

-----------------------------------------------------------------

nl2br — 在字符串所有新行之前插入 HTML 换行标记

parse_str — Parses the string into variables {void parse_str ( string $str [, array &$arr ] )}

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

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

-----------------------------------------------------------------

str_getcsv — 解析 CSV 字符串为一个数组

fgetcsv - 从文件指针中读入一行并解析 CSV 字段

-----------------------------------------------------------------

str_replace() - 子字符串替换

mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )

str_ireplace — str_replace 的忽略大小写版本

preg_replace() - 执行正则表达式的搜索和替换

mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )

strtr - 转换指定字符

string  strtr (  string $str ,  string $from ,  string $to )
string  strtr (  string $str ,  array $replace_pairs )

str_repeat — 重复一个字符串

string str_repeat ( string $input , int $multiplier )

str_pad - 使用另一个字符串填充字符串为指定长度

string str_pad ( string $input , int $pad_length [, string $pad_string = " " [, int $pad_type = STR_PAD_RIGHT ]] )

-----------------------------------------------------------------

substr — 返回字符串的子串

string substr ( string $string , int $start [, int $length ] )

substr_replace — 替换字符串的子串

mixed substr_replace ( mixed $string , string $replacement , int $start [, int $length ] )

substr_count — 计算字串出现的次数

int substr_count ( string $haystack , string $needle [, int $offset = 0 [, int $length ]] )

-----------------------------------------------------------------

str_rot13 — 对字符串执行 ROT13 转换

-----------------------------------------------------------------

strrev — 反转字符串

str_shuffle — 随机打乱一个字符串

-----------------------------------------------------------------

str_word_count — 返回字符串中单词的使用情况 

mixed str_word_count ( string $string [, int $format = 0 [, string $charlist ]] )

-----------------------------------------------------------------

substr_compare — 二进制安全比较字符串(从偏移位置比较指定长度)

strcasecmp — 二进制安全比较字符串(不区分大小写)

strncasecmp — 二进制安全比较字符串开头的若干个字符(不区分大小写)

strcmp — 二进制安全字符串比较 int strcmp ( string $str1 , string $str2 )

strncmp — 二进制安全比较字符串开头的若干个字符

strnatcmp — 使用自然排序算法比较字符串

strnatcasecmp — 使用“自然顺序”算法比较字符串(不区分大小写)

-----------------------------------------------------------------

strpos — 查找字符串首次出现的位置 int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )

stripos — 查找字符串首次出现的位置(不区分大小写)

strrpos — 计算指定字符串在目标字符串中最后一次出现的位置

strripos — 计算指定字符串在目标字符串中最后一次出现的位置(不区分大小写)

-----------------------------------------------------------------

strstr — 查找字符串的首次出现 {string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] )}

strchr — 别名 strstr

stristr — strstr 函数的忽略大小写版本

strrchr — 查找指定字符在字符串中的最后一次出现

-----------------------------------------------------------------

strspn — 返回在字符串中包含的特定字符的数目 {int strspn ( string $subject , string $mask [, int $start [, int $length ]] )}

strcspn — 返回在找到任何指定的字符之前,在字符串查找的字符数。

-----------------------------------------------------------------

strlen — 获取字符串长度

-----------------------------------------------------------------

strpbrk — 在字符串中查找一组字符的任何一个字符

 

count_chars — 返回字符串所用字符的信息

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值