How to Explode String Right to Left?

前端 未结 12 829
灰色年华
灰色年华 2020-12-31 03:22
$split_point = \' - \';
$string = \'this is my - string - and more\';

How can i make a split using the second instance of $split_point and not the

12条回答
  •  臣服心动
    2020-12-31 03:47

    Not sure why no one posted a working function with $limit support though here it is for those who know that they'll be using this frequently:

    '.print_r(explode_right(1, $string, 3),1).'
    '; ?>

提交回复
热议问题