php常用函数-(10)php字符串处理常用的函数

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

addslashes — 使用反斜线引用字符串

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

chop — rtrim() 的别名

chr — 返回指定的字符

chunk_split — 将字符串分割成小块

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

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

crypt — One-way string encryption (hashing)

echo — Output one or more strings

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

fprintf — Write a formatted string to a stream

get_html_translation_table — Returns the translation table used by htmlspecialchars() and htmlentities()

hebrev — Convert logical Hebrew text to visual text

hebrevc — Convert logical Hebrew text to visual text with newline conversion

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

htmlspecialchars — Convert special characters to HTML entities

implode — Join array elements with a string

join — 别名 implode()

levenshtein — Calculate Levenshtein distance between two strings

localeconv — Get numeric formatting information

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

md5_file — Calculates the md5 hash of a given file

md5 — Calculate the md5 hash of a string

metaphone — Calculate the metaphone key of a string

money_format — Formats a number as a currency string

nl_langinfo — Query language and locale information

nl2br — Inserts HTML line breaks before all newlines in a string

number_format — Format a number with grouped thousands

ord — Return ASCII value of character

parse_str — Parses the string into variables

print — Output a string

printf — Output a formatted string

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

quotemeta — Quote meta characters

rtrim — Strip whitespace (or other characters) from the end of a string

setlocale — Set locale information

sha1_file — Calculate the sha1 hash of a file

sha1 — Calculate the sha1 hash of a string

similar_text — Calculate the similarity between two strings

soundex — Calculate the soundex key of a string

sprintf — Return a formatted string

sscanf — Parses input from a string according to a format

str_getcsv — Parse a CSV string into an array

str_ireplace — Case-insensitive version of str_replace().

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

str_repeat — Repeat a string

str_replace — Replace all occurrences of the search string with the replacement string

str_rot13 — Perform the rot13 transform on a string

str_shuffle — Randomly shuffles a string

str_split — Convert a string to an array

str_word_count — Return information about words used in a string

strcasecmp — Binary safe case-insensitive string comparison

strchr — 别名 strstr()

strcmp — Binary safe string comparison

strcoll — Locale based string comparison

strcspn — Find length of initial segment not matching mask

strip_tags — Strip HTML and PHP tags from a string

stripcslashes — Un-quote string quoted with addcslashes()

stripos — Find position of first occurrence of a case-insensitive string

stripslashes — Un-quote string quoted with addslashes()

stristr — Case-insensitive strstr()

strlen — Get string length

strnatcasecmp — Case insensitive string comparisons using a “natural order” algorithm

strnatcmp — String comparisons using a “natural order” algorithm

strncasecmp — Binary safe case-insensitive string comparison of the first n characters

strncmp — Binary safe string comparison of the first n characters

strpbrk — Search a string for any of a set of characters

strpos — Find position of first occurrence of a string

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

strrev — Reverse a string

strripos — Find position of last occurrence of a case-insensitive string in a string

strrpos — Find position of last occurrence of a char in a string

strspn — Find length of initial segment matching mask

strstr — Find first occurrence of a string

strtok — Tokenize string

strtolower — Make a string lowercase

strtoupper — Make a string uppercase

strtr — Translate certain characters

substr_compare — Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters

substr_count — Count the number of substring occurrences

substr_replace — Replace text within a portion of a string

substr — Return part of a string

trim — Strip whitespace (or other characters) from the beginning and end of a string

ucfirst — Make a string’s first character uppercase

ucwords — Uppercase the first character of each word in a string

vfprintf — Write a formatted string to a stream

vprintf — Output a formatted string

vsprintf — Return a formatted string

wordwrap — Wraps a string to a given number of characters using a string break character

010832918

本文来自投稿,不代表重蔚自留地立场,如若转载,请注明出处https://www.cwhello.com/540.html

如有侵犯您的合法权益请发邮件951076433@qq.com联系删除

(0)
重蔚的头像重蔚管理团队
上一篇 2015年12月7日 17:06
下一篇 2015年12月7日 17:14

相关推荐

  • PHP函数的说明

    函数的调用者把实际的数据传递给函数的形参,这个时候的形参只能在函数内使用。 函数在运行代码时会新建一个新空间来运行函数内的代码 运行代码后,如果有返回值,把结果返回给函数的调用者,这个时候运行函数的这…

    2018年4月4日
    0228
  • 我的php学习第二十六天——流程控制

    流程控制 PHP有三种流程控制结构:顺序结构,分支结构,循环结构 默认的,代码的执行结构都是顺序结构。代码一行一行从上往下执行。顺序结构是程序代码的最基本结构。 分支结构:一段代码根据不同的条件执行不同的…

    2017年5月3日 PHP自学教程
    0357
  • php的可变函数

    说明:就是一个变量如果加上括号,PHP的系统会解析成函数,这个变量的值必须是一个函数的名,否则报错,未定义了。 案例

    2018年4月5日
    0215
  • php微信第三方实现一键登录及获取用户信息的方法(附代码)

    具体如下: 注意:要使用微信在第三方网页登录是需要“服务号”才可以哦,所以必须到官方申请。 一开始你需要进入微信公众平台开启开发模式,并且填写oauth2的回调地址,地址填写你项目的域名就可以了.比如:www.baidu.c…

    2018年3月2日
    0234
  • 使用PHP导入和导出CSV文件(附代码)

    项目开发中,很多时候要将外部CSV文件导入到数据库中或者将数据导出为CSV文件,那么具体该如何实现呢?本文将使用PHP并结合mysql,实现了CSV格式数据的导入和导出功能。 我们先准备mysql数据表,假设项目中有一张记…

    2018年2月28日
    0395
  • php基本语法-函数

    函数的主要功能: 代码重复性使用 模块化编程 函数的定义: 定义语法: function 函数名([参数1,参数2,参数n]){        函数体;        [return;] } 调用语法: 函数名([实参1,实参2,实参n]); 函数定义及调用 例1:…

    2017年9月26日 PHP自学教程
    0226
  • php字符串处理函数大全

    addcslashes — 为字符串里面的部分字符添加反斜线转义字符 addslashes — 用指定的方式对字符串里面的字符进行转义 bin2hex — 将二进制数据转换成十六进制表示 chop — rtrim() 的别名函数 chr — 返回一个字符的ASCII…

    2018年3月3日
    0286
  • (实用篇)PHP实现队列及队列原理

    队列说明 队列是一种线性表,按照先进先出的原则进行的: 实现队列 PHP实现队列:第一个元素作为队头,最后一个元素作为队尾 <?php /** * 队列就是这么简单 * * @link */ $array =  array('PHP', 'JAVA'); array…

    2016年10月26日
    0290

联系我们

QQ:951076433

在线咨询:点击这里给我发消息邮件:951076433@qq.com工作时间:周一至周五,9:30-18:30,节假日休息