位置: 编程技术 - 正文

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

  • 企业所得税法
  • 汇算清缴利润调整会计分录
  • 发债评级机构 有哪些
  • 管理费用和研发费用的区别
  • 增值税不视同销售行为有哪些
  • 市场运营部门工作职责
  • 有形动产租赁服务计入什么科目
  • 金蝶kis 反结账
  • 租出非专利技术的摊销额会导致营业利润减少吗
  • 小规模纳税人开普票要交税吗
  • 退休返聘人员工资
  • 期末留抵税额可以留多久
  • 附加税按实际缴纳计提吗
  • 部分预收账款会计科目
  • 公司付给职工的工资
  • 发票认证后1年还能用吗
  • 营业账簿是什么意思
  • 票据单据较多,费用报销单一张不够填怎么办?
  • 实收资本何时交税
  • 停车场收入如何确认缴税
  • 进项税抵扣需要做分录吗
  • 交强险保单被保险人写谁都行?
  • 年度成本费用利润率多少合适
  • 跨年退货会计处理
  • 暂估入库入库单范本
  • 车间购买办公用品
  • sesvc.exe是什么进程
  • 小刺猬 (© lorenzo104/Getty Images)
  • 堡垒封印
  • vue中使用nodejs
  • 微信小程序使用时间记录查询
  • php plates
  • 分公司股东怎么填
  • zend框架教程
  • php常用array函数
  • 小微企业免税额怎么计算
  • 折扣方式销售有哪些类型
  • 以前年度损益调整怎么做账
  • vue实现响应式的原理
  • 购买方享受的现金折扣
  • 原始凭证可以外带吗
  • 个体工商户可以抵扣进项吗
  • db2数据库创建索引语句
  • mysqlreport显示Com_中change_db占用比例高的问题的解决方法
  • sql实现split函数的脚本
  • 职工意外险怎么记账
  • 研发费用账务处理一定在管理费用吗
  • 资本公积金转增股本会计处理
  • 施工单位结算
  • 办理股权转让需要多久时间
  • 进口货物的价格组成有哪些
  • 福利费可以直接发钱吗
  • 稳岗补贴如何入账
  • 培训机构账务处理
  • 酒店酒水成本核算表
  • sql合并数据库
  • mysql数据库迁移上云
  • 全国县市区最多的省
  • Windows Server 2003下DHCP服务器的安装与简单配置图文教程
  • windowsserver2008r2版本区别
  • linux连接vps
  • fedora os
  • Win10任务栏天气怎么关闭
  • mac桌面应用
  • windows打开或关闭功能
  • ubuntucommand not found
  • caddll丢失
  • javascript的语法在哪一项中规定
  • opengl示例
  • javascript几种数据类型
  • bash linux命令
  • 批量修改ssh配置端口
  • Please ensure that adb is correctly located at 'D:Androidandroid-sdkplatform-toolsadb.exe' and
  • python 中 range
  • vue瀑布流实现
  • javascript 对象
  • 打印个人住房信息查询记录需要什么资料
  • 日常生活中有哪些税
  • 国税增值税普通发票
  • 营业税改征增值税对哪些行业影响最大
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设