当前位置:网站首页>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边栏推荐
- opencv鼠标键盘事件
- 2022 East China Normal University postgraduate entrance examination machine test questions - detailed solution
- Summary of remote connection of MySQL
- Thoughts in Starbucks
- RestHighLevelClient获取某个索引的mapping
- 机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)
- Modify MySQL password
- Application scenarios of Catalan number
- Derivation of variance iteration formula
- ssh链接远程服务器 及 远程图形化界面的本地显示
猜你喜欢

Software testing learning - the next day

Integration test practice (1) theoretical basis

Yolov2 learning and summary

Ruoyi interface permission verification

New knowledge! The virtual machine network card causes your DNS resolution to slow down

Arctic code vault contributor

【无标题】

SQL implementation merges multiple rows of records into one row

Asynchronous programming: async/await in asp Net

2022年华东师范大学计科考研复试机试题-详细题解
随机推荐
2022 CISP-PTE(三)命令执行
Stream stream
[untitled] 8 simplified address book
Dbnet: real time scene text detection with differentiable binarization
Yolov2 learning and summary
数值法求解最优控制问题(一)——梯度法
修改MySQL密码
Asynchronous programming: async/await in asp Net
Integration test practice (1) theoretical basis
Resttemplate configuration use
scroll-view指定滚动元素的起始位置
Architecture notes
My 2020 summary "don't love the past, indulge in moving forward"
opencv
MySQL installation
“我为开源打榜狂”第一周榜单公布,160位开发者上榜
2022年华东师范大学计科考研复试机试题-详细题解
Realize PDF to picture conversion with C #
Application scenarios of Catalan number
Pytest attempts to execute the test case without skipping, but the case shows that it is all skipped