当前位置:网站首页>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 - relevantNote, 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边栏推荐
- The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list
- Summary of the design and implementation of the weapon system similar to the paladin of vitality
- 2022年华东师范大学计科考研复试机试题-详细题解
- Pytest attempts to execute the test case without skipping, but the case shows that it is all skipped
- [LeetCode]404. Sum of left leaves
- Abstract learning
- Software testing learning - the next day
- The essence of interview
- 100000 bonus is divided up. Come and meet the "sister who braves the wind and waves" among the winners
- Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
猜你喜欢

Realize PDF to picture conversion with C #

卡特兰数(Catalan)的应用场景

In depth analysis of reentrantlock fair lock and unfair lock source code implementation

Example of joint use of ros+pytoch (semantic segmentation)

Liang Ning: 30 lectures on brain map notes for growth thinking
![[classes and objects] explain classes and objects in simple terms](/img/41/250457530880dfe3728432c2ccd50b.png)
[classes and objects] explain classes and objects in simple terms

Scroll view specifies the starting position of the scrolling element

The pressure of large institutions in the bear market has doubled. Will the giant whales such as gray scale, tether and micro strategy become 'giant thunder'?

Summary of UI module design and practical application of agent mode

golang操作redis:写入、读取kv数据
随机推荐
[LeetCode]404. Sum of left leaves
[5g NR] UE registration process
La loi des 10 000 heures ne fait pas de vous un maître de programmation, mais au moins un bon point de départ
Software testing assignment - the next day
The dynamic analysis and calculation of expressions are really delicious for flee
这两种驱蚊成份对宝宝有害,有宝宝的家庭,选购驱蚊产品要注意
Liang Ning: 30 lectures on brain map notes for growth thinking
Unit test framework + Test Suite
scroll-view指定滚动元素的起始位置
golang操作redis:写入、读取hash类型数据
数值法求解最优控制问题(一)——梯度法
Software testing assignment - day 3
每日刷题记录 (十一)
Simple understanding of bubble sorting
【无标题】
DNS forward query:
Getting started with pytest
[open source project recommendation colugomum] this group of undergraduates open source retail industry solutions based on the domestic deep learning framework paddlepadddle
Basic teaching of crawler code
Personally design a highly concurrent seckill system