相关疑难解决方法(0)

如何从右到左爆炸弦?

$split_point = ' - ';
$string = 'this is my - string - and more';
Run Code Online (Sandbox Code Playgroud)

如何使用$ split_point的第二个实例而不是第一个实例进行拆分.我能以某种方式指定从右到左的搜索吗?最简单的方法?

基本上我如何从右到左爆炸.我想拿起" - "的最后一个例子.

结果我需要:

$item[0]='this is my - string'; $item[1]='and more';
Run Code Online (Sandbox Code Playgroud)

并不是:

$item[0]='this is my'; $item[1]='string - and more';
Run Code Online (Sandbox Code Playgroud)

php string

18
推荐指数
4
解决办法
2万
查看次数

标签 统计

php ×1

string ×1