当前位置:网站首页>How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
2022-07-03 06:52:00 【Zafo】
problem :
How can I split a string at the first occurrence of - (minus sign) into two $vars with PHP? How to appear for the first time - ( minus sign ) Split the string into two bands PHP Of $ vars?
I have found how to split on every "-" but, not only on the first occurrence. I have found out how to split each “ - ”, But not just when it first appeared .
example: example :
this - is - line - of whatever - is - relevant$var1 = this$var2 = is - line - of whatever - is - relevant
Note, also stripped the first "-" . Be careful , Also stripped the first one “ - ”.
Thanks in advance for the help! Thank you for your help !
Solution :
Reference resources : https://stackoom.com/en/question/EiZ3边栏推荐
- 堆排序和优先队列
- Journal quotidien des questions (11)
- 机械观和系统观的科学思维方式各有什么特点和作用
- Personally design a highly concurrent seckill system
- Example of joint use of ros+pytoch (semantic segmentation)
- Software testing assignment - the next day
- Stream stream
- Summary of remote connection of MySQL
- Summary of the design and implementation of the weapon system similar to the paladin of vitality
- Search engine Bing Bing advanced search skills
猜你喜欢
多个全局异常处理类,怎么规定执行顺序
Winter vacation work of software engineering practice
The 10000 hour rule won't make you a master programmer, but at least it's a good starting point
远端rostopic的本地rviz调用及显示
Summary of UI module design and practical application of agent mode
Operation principle of lua on C: Foundation
Realize PDF to picture conversion with C #
Daily question brushing record (11)
Numerical method for solving optimal control problem (I) -- gradient method
【无标题】
随机推荐
【无标题】
Daily question brushing record (11)
Understand software testing
Derivation of variance iteration formula
HMS core helps baby bus show high-quality children's digital content to global developers
Asynchronous programming: async/await in asp Net
ROS+Pytorch的联合使用示例(语义分割)
How to plan well?
每日刷题记录 (十一)
机械观和系统观的科学思维方式各有什么特点和作用
Journal quotidien des questions (11)
[5g NR] UE registration process
UTC时间、GMT时间、CST时间
Application scenarios of Catalan number
Software testing learning - the next day
DBNet:具有可微分二值化的实时场景文本检测
Thoughts in Starbucks
[untitled] 5 self use history
这两种驱蚊成份对宝宝有害,有宝宝的家庭,选购驱蚊产品要注意
Basic teaching of crawler code