needle: /
string: o/a/i
如果 before_needle 为 1,则排除 needle:“o/a”
如果 before_needle 为 false,则包含 needle:“/i”
作为代码
$str="o/a/i";
$cs="/";
echo "如果 before_needle == 1,则排除 needle"."\n";
$str="o/a/i";
$cs="/";
echo mb_strrchr ($str,$cs,1)."\n";
echo "如果 before_needle == false,则包含 needle"."\n";
$str="o/a/i";
$cs="/";
echo mb_strrchr ($str,$cs,0)."\n";