我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php preg_split第一个大写

Using the following code, php explode at capital letters?

you can explode the string by uppercase. But how do you explode it only on the first uppercase? Say you have helloThereMister. I want to get hello ThereMister. I can concatenate the result from the link above, but if there is a way to skip it, then fantastic!

Thanks

RTM my friend, as per documentation of preg_split you have also a $limit parameter so the answer is:

$pieces = preg_split('/(?=[A-Z])/', $str, 1);

look at manual for preg_split, third argument

近期文章

  • 前段学生假期兼职并提升技术水平
  • 细菌Δtdk的作用是什么
  • 关于#四阶行列式的解法#哪位朋友能解一下
  • 对于wor中的表格绘制方法
  • javascript react-simple-chatbot 如何使用?
  • c语言 代码 else语句没执行
  • 根据时间隐藏div - PHP
  • 关于#c++#的问题,请各位专家解答!
  • 线性代数,数学难题,头秃了🆘
  • 学了几天c语言,没想到基础知识给我整蒙了。
  • Ubuntu安装不了出了问题
  • 路由器漏洞复现,遇到问题,求帮助
  • switch语句的case后面可以这样写吗
  • 邮件内容的空白输出
  • MATLAB求正态分布中大于某个固定值的概率
  • 请问这个方程组用matlab怎么解
  • python和C语言的互转
  • matlab如何调用C++
  • 和答案是一样的,答案是26,但是pta上显示答案错误
  • 提取了图像的尺寸,颜色纹理等特征之后有什么方法可以对它们进行融合?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华