needle: /
string: o/a/i
if before_needle is 1 then needle is excluded: "o/a"
if before_needle is false then needle is included: "/i"
as code:
$str="o/a/i";
$cs="/";
echo "if before_needle == 1 then needle is excluded"."\n";
$str="o/a/i";
$cs="/";
echo mb_strrchr ($str,$cs,1)."\n";
echo "if before_needle == false then needle is included"."\n";
$str="o/a/i";
$cs="/";
echo mb_strrchr ($str,$cs,0)."\n";