位置: 编程技术 - 正文

PHP:spliti()的用法_Regex正则函数(php str split)

编辑:rootadmin
spliti

推荐整理分享PHP:spliti()的用法_Regex正则函数(php str split),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php split,php splice,php splfileobject,phpstr_split,php中split,php str split,phpstr_split,php splice,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4 >= 4.0.1, PHP 5)

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

说明 array spliti ( string $pattern , string $string [, int $limit = -1 ] )

用正则表达式将一个 string 分割成数组。

本函数和 split() 相同,只除了在匹配字母字符时忽略大小写的区别。

Warning

自 PHP 5.3.0起,已经废弃此函数。强烈建议不要应用此函数 。

参数

pattern

大小写不敏感的正则表达式。

If you want to split on any of the characters which are considered special by regular expressions, you&#;ll need to escape them first. If you think spliti() (or any other regex function, for that matter) is doing something weird, please read the file regex.7, included in the regex/ subdirectory of the PHP distribution. It&#;s in manpage format, so you&#;ll want to do something along the lines of man /usr/local/src/regex/regex.7 in order to read it.

string PHP:spliti()的用法_Regex正则函数(php str split)

输入的字符。

limit

如果设置了 limit,返回的数组最多会包含 limit 个元素,最后一个元素包含了剩下的全部 string。

返回值

Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the case insensitive regular expression pattern.

If there are n occurrences of pattern, the returned array will contain n+1 items. For example, if there is no occurrence of pattern, an array with only one element will be returned. Of course, this is also true if string is empty. If an error occurs, spliti() returns FALSE.

范例

本例用 &#;a&#; 做分隔符来分割一个字符串:

Example #1 spliti() 例子

<?php$string="aBBBaCCCADDDaEEEaGGGA";$chunks=spliti("a",$string,5);print_r($chunks);?>

以上例程会输出:

注释

Note:

在 PHP 5.3.0中,已放弃使用 regex 扩展而建议使用 PCRE 扩展。调用此函数将会发出E_DEPRECATED 通知。参见“差异列表”可帮助你转为使用 PCRE。

参见

preg_split() - 通过一个正则表达式分隔字符串 split() - 用正则表达式将字符串分割到数组中 explode() - 使用一个字符串分割另一个字符串 implode() - 将一个一维数组的值转化为字符串

PHP:ereg_replace()的用法_Regex正则函数 ereg_replace(PHP4,PHP5)ereg_replace正则表达式替换说明stringereg_replace(string$pattern,string$replacement,string$string)本函数在string中扫描与pattern匹配的部分,并将其替换

PHP:preg_replace()的用法_PCRE正则函数 preg_replace(PHP4,PHP5)preg_replace执行一个正则表达式的搜索和替换说明mixedpreg_replace(mixed$pattern,mixed$replacement,mixed$subject[,int$limit=-1[,int&$count]])搜索subject中匹配

PHP:preg_match()的用法_PCRE正则函数 preg_match(PHP4,PHP5)preg_match执行一个正则表达式匹配说明intpreg_match(string$pattern,string$subject[,array&$matches[,int$flags=0[,int$offset=0]]])搜索subject与pattern给定的正则

标签: php str split

本文链接地址:https://www.jiuchutong.com/biancheng/279882.html 转载请保留说明!

上一篇:PHP:eregi_replace()的用法_Regex正则函数

下一篇:PHP:ereg_replace()的用法_Regex正则函数

  • 增值税专用发票可以开电子发票吗
  • 个人缴纳职业年金是什么意思
  • 基本账户转到一类卡
  • 办理个体户营业执照需要什么条件
  • 模具发票如何入账
  • 银行代扣的社保怎么查询
  • 车辆购置税账务怎么处理流程
  • 红字信息表跨月了还能开吗
  • 咨询服务费没有发票
  • 现代服务业营改增前后税率对比表
  • 出口销售收入怎么算
  • 失控发票进项税转出企业无法承担所得税怎么办
  • 数量金额式适用于哪些科目
  • 防洪费2019年税率
  • 加工贸易企业如何财务管理账务流程
  • 公司的资产负债表包括
  • 施工项目直接成本和间接成本
  • 顶账物品都有哪些
  • 企业报税流程图
  • 资产负债表中资产项目的排列顺序是
  • 天猫积分类服务费账务处理
  • 鸿蒙系统快捷键
  • php可变参数
  • 进项抵扣发票如何查询
  • 个体户要交哪些税怎么交
  • 企业股权转让所得可以弥补亏损吗
  • smarty怎么用
  • 未使用的土地使用权可以摊销吗
  • uniapp打开h5页面
  • 什么情况下附加税减半征收
  • 详解Yii2.0 rules验证规则集合
  • yolox改进
  • docker windows -v
  • ip6tables-save命令 保存ip6tables表配置
  • jquery+thinkphp实现跨域抓取数据的方法
  • 企业年产值与年收入比例
  • mysqldump -r
  • 材料已经入库但是没有发票怎么做账
  • 单位购买预付卡可以用现金吗
  • 销售不动产统一发票怎么没有税率
  • 安装sqlserver2005警告iis
  • 物业费分解
  • 企业拆迁补偿款
  • 计提环保税的会计分录
  • 暂估入账后续处理
  • 税务局收款收据
  • 职工医保门诊一年报销多少钱
  • 资产处置费用是资产类科目吗
  • 年度纳税总额包括个税吗
  • 哪些商业保险可以抵扣个税
  • 递延所得税转回税率不一致
  • 关于低值易耗品的评估说法正确的有()
  • 会计学主要是学什么
  • 目前默认系统%1
  • crack.exe是什么意思
  • win32k.sys是什么
  • 这张图告诉我们什么道理
  • explorer.exe进程文件
  • linux系统漏洞总结
  • linux连接windows的服务redis
  • secondoption是什么意思
  • win10周年版
  • linux如何使用
  • windows10专业版界面预览
  • addObserver和postNotification函数传递函数的区别
  • jquery 案例
  • transformer可视化
  • 在dos下删除文件
  • python进行聚类
  • 置顶聊天的人怎么不见了
  • jquery怎么修改样式
  • ajax 分页
  • 朵朵舞百科
  • 怎样下载金税盘
  • 安徽营业执照网上怎么申请
  • 扬州地方税务局在哪
  • 湖南省国家税务局历任局长
  • 智能财税证书含金量
  • 广东可以去吗
  • 增值税电子专用发票怎么作废
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设