位置: 编程技术 - 正文

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正则函数

  • 车辆购置税是什么税种
  • 存货核算的内容是什么
  • 多交企业所得税可以放弃退税吗
  • 费用化的研发支出是否可以加计扣除
  • 印花税5元贴花会计处理
  • 开票加收税点会减少吗
  • 电商存货周转率的正常范围
  • 实收资本如何网上转账
  • 网上车辆购置税缴纳
  • 土地返还款属于政府补助吗
  • 一般纳税人可以转小规模吗
  • 对非本单位的营销方案
  • 营改增租金收入税率
  • 法的分级
  • 代扣代缴的增值税可以作为进项税抵扣吗
  • 建筑业简易征收差额征税的计算案例
  • 如何看发票是否被抵扣
  • 兼营免税减税项目
  • 工会筹备金需要在年终汇算调增吗
  • 上级工会返还的会计分录
  • 单独计价入账的土地是固定资产吗
  • 销售后换回产品的账务处理怎么做?
  • 附加税零申报怎么申报
  • 工厂材料成本改善报告范文
  • 工资薪金所得税前扣除项目标准
  • 汇兑损益 纳税调整
  • 电脑重装win7系统后无法连接网络
  • surface pro记笔记
  • linux安装方式
  • 苹果推送最新系统怎么弄
  • 什么情况下专硕可以调剂学硕
  • 一般纳税人辅导期最新规定
  • 软件企业高新技术有哪些
  • 固定资产未提完折旧可以报废吗
  • ChatGPT会让6个低端岗位失业
  • win10本地模式
  • 未拿到发票怎么做账
  • 商贸公司会计成本核算
  • 专票认证对企业有影响吗
  • 新注册企业实收资本没到账怎么处理
  • 营改增之前的工程还能开票吗
  • 电子发票怎么开具流程呢?
  • 预付开发票加油后还能开吗?
  • 建筑企业会计科目的设置及核算
  • 外购货物用于公益性捐赠
  • 应交税费会计分录完整版
  • 企业计提固定资产折旧以什么假设为前提
  • 开具房租发票的分录如何做?
  • 企业哪些情况下需要交税
  • 以前年度损益调整
  • 印花税处罚适用征管法六十四条规定
  • 什么叫代销合同
  • 残保金是第二年交前一年的吗
  • 发票什么情况下可以作废
  • 未开票收入如何申报增值税,下个月怎么操作
  • 发票章盖得不清晰怎么办
  • 教育机构的咨询
  • 财经网课 app
  • mysql中的ifnull函数
  • soft version
  • xp系统怎么提升性能
  • windows server 2008 r2怎么用u盘启动
  • 怎么看mac的硬盘型号
  • mac音频设置在哪里
  • 怎么关闭xp系统弹窗
  • centos 7 远程桌面
  • windows7的开机启动项在哪里
  • android游戏开发 教程
  • python如何用turtle
  • 输入命令的三种方法
  • 样式默认有几种修改格式
  • Node.js中的包管理工具是什么
  • shell脚本switch
  • vue组件精讲
  • python做开发
  • javascript怎么学
  • 税务巡视组一般检查什么
  • 设立新的机构或开办新的业务
  • 武汉税务电话号码
  • 怎么查询手机发票
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设