字符串
PHP Manual

更新日志

对本扩展的类/函数/方法有以下更新。

VersionFunctionDescription
5.6.5cryptWhen the failure string "*0" is given as the salt, "*1" will now be returned for consistency with other crypt implementations. Prior to this version, PHP 5.6 would incorrectly return a DES hash.
5.6.0cryptRaise E_NOTICE security warning if salt is omitted.
 html_entity_decodeThe default value for the encoding parameter was changed to be the value of the default_charset configuration option.
 htmlentitiesThe default value for the encoding parameter was changed to be the value of the default_charset configuration option.
 htmlspecialcharsThe default value for the encoding parameter was changed to be the value of the default_charset configuration option.
 substr_comparelength 可以是 0。
5.5.21cryptWhen the failure string "*0" is given as the salt, "*1" will now be returned for consistency with other crypt implementations. Prior to this version, PHP 5.5 (and earlier branches) would incorrectly return a DES hash.
5.5.1hex2bin如果输入的字符串是无效的十六进制字符串则抛出一个警告,
5.4.4hex2bin如果输入的字符串有多余将抛出异常。 PHP 5.4.0 起字符串将被静默地接受,但是最后的字节会被截断。
5.4.0get_html_translation_tableThe default value for the encoding parameter was changed to UTF-8.
 get_html_translation_tableThe constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 html_entity_decodeThe constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 html_entity_decodeDefault encoding changed from ISO-8859-1 to UTF-8.
 htmlentitiesThe default value for the encoding parameter was changed to UTF-8.
 htmlentitiesThe constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 htmlspecialcharsThe default value for the encoding parameter was changed to UTF-8.
 htmlspecialcharsThe constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 htmlspecialchars_decode增加了 ENT_HTML401、ENT_XML1、 ENT_XHTML 和 ENT_HTML5 等常量。
 number_formatThis function now supports multiple bytes in dec_point and thousands_sep. Only the first byte of each separator was used in older versions.
5.3.7cryptAdded $2x$ and $2y$ Blowfish modes to deal with potential high-bit attacks.
5.3.4get_html_translation_tableThe encoding parameter was added.
5.3.2crypt基于 Ulrich Drepper 的实现,新增基于 SHA-256 算法和 SHA-512 算法的 crypt。
 crypt修正了 Blowfish 算法由于非法循环导致的问题,返回“失败”字符串(“*0” 或 “*1”)而不是转而使用 DES 算法。
5.3.0cryptPHP 现在包含了它自己的 MD5 Crypt 实现,包括标准 DES 算法,扩展的 DES 算法以及 Blowfish 算法。如果系统缺乏相应的实现,那么 PHP 将使用它自己的实现。
 htmlentitiesThe constant ENT_IGNORE was added.
 htmlspecialcharsThe constant ENT_IGNORE was added.
 nl2br新增可选的 is_xhtml 参数。
 setlocaleThis function now throws an E_DEPRECATED notice if a string is passed to the category parameter instead of one of the LC_* constants.
 stristr新增可选的 before_needle 参数。
 strlenPrior versions treated arrays as the string Array, thus returning a string length of 5 and emitting an E_NOTICE level error.
 strstr新增可选的 before_needle 参数。
5.2.5addcslashesThe escape sequences \v and \f were added.
5.2.3htmlentitiesThe double_encode parameter was added.
 htmlspecialcharsThe double_encode parameter was added.
5.2.2 - 5.2.6substrIf the start parameter indicates the position of a negative truncation or beyond, false is returned. Other versions get the string from start.
5.1.0explode支持负数的 limit
 md5_file函数改用流 API。这意味着能够配合封装器使用该函数,比如 md5_file('http://example.com/..')。
 sha1_file改变函数以使用流 API。这意味着可以使用包装器,比如 sha1_file('http://example.com/..')。
 str_word_count新增 charlist 参数。
 substr_compare允许使用负数的 offset 参数。
 substr_count新增 offset 和 length 参数。
5.0.0md5新增 raw_output 参数。
 sha1新增 raw_output 参数。
 strip_tagsstrip_tags 变为二进制安全的。
 strrpos引入 offset 参数。
 strrpos参数 needle 可以是一个多字符的字符串。
4.3.3substr_replaceAll parameters now accept arrays.
4.3.0stristrstristr 变为二进制安全的。
 strrchr该函数是二进制安全的。
 strspn新增 start 和 length 参数。
 strstrstrstr 成为二进制安全的。
4.2.3strcoll函数在 Win32 平台可用。
4.1.0trim新增可选的 charlist 参数。
4.0.5nl2brnl2br 成为 XHTML 兼容的操作。所有的旧版本都会在 string 的新行之前插入 '<br>' 而不是 '<br />'。
4.0.1explode增加了参数 limit

字符串
PHP Manual