$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)