位置: 编程技术 - 正文
推荐整理分享PHP字符串函数implode()的用法(php 字符串函数),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:php 字符串函数,php string函数,php字符串函数大全,php字符串赋值,php字符串赋值,在php中,字符串有哪些表示形式,php 字符串函数,php字符串型数据的定义方式,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 4, PHP 5)
implode — 将一个一维数组的值转化为字符串
说明 string implode ( string $glue , array $pieces ) string implode ( array $pieces )用 glue 将一维数组的值连接为一个字符串。
Note:
因为历史原因implode()的参数顺序可以是随意的,explode()也一样
参数glue
默认为空的字符串。
pieces你想要转换的数组。
返回值返回一个字符串,其内容为由 glue 分割开的数组的值。
更新日志版本 说明 4.3.0 glue 变为可选参数。
范例
Example #1 implode() 例子
<?php$array=array('lastname','email','phone');$comma_separated=implode(",",$array);echo$comma_separated;//lastname,email,phone//Emptystringwhenusinganemptyarray:var_dump(implode('hello',array()));//string(0)""?> 注释Note: 此函数可安全用于二进制对象。
参见explode() - 使用一个字符串分割另一个字符串 preg_split() - 通过一个正则表达式分隔字符串 http_build_query() - 生成 URL-encode 之后的请求字符串
PHP字符串函数htmlspecialchars_decode()的用法 htmlspecialchars_decode(PHP5=5.1.0)htmlspecialchars_decode将特殊的HTML实体转换回普通字符说明stringhtmlspecialchars_decode(string$string[,int$flags=ENT_COMPAT|ENT_HTML])此函数的
PHP字符串函数html_entity_decode()的用法 html_entity_decode(PHP4=4.3.0,PHP5)html_entity_decodeConvertallHTMLentitiestotheirapplicablecharacters说明stringhtml_entity_decode(string$string[,int$flags=ENT_COMPAT|ENT_HTML[,string$encoding=in
PHP字符串函数hex2bin()的用法 hex2bin(PHP=5.4.0)hex2bin转换十六进制字符串为二进制字符串说明stringhex2bin(string$data)转换十六进制字符串为二进制字符串。Caution这个函数不是转换十六进制
标签: php 字符串函数
本文链接地址:https://www.jiuchutong.com/biancheng/279855.html 转载请保留说明!友情链接: 武汉网站建设