lib/Face/Util/StringUtils.php
public static function subStringBeforeLast($haystack, $needle, $n = 1)
    {
        while ($n>0) {
            $haystack = substr($haystack, 0, strrpos($haystack, $needle));
            $n--;
        }
        return $haystack;
    }
public static function subStringBeforeLast($haystack, $needle, $n = 1)
    {
        while ($n>0) {
            $haystack = substr($haystack, 0, strrpos($haystack, $needle));
            $n--;
        }
        return $haystack;
    }
public static function subStringBeforeLast ( $ haystack , $ needle , $ n = 1 ) { while ( $ n > 0 ) { $ haystack = substr ( $ haystack , 0 , strrpos ( $ haystack , $ needle ) ) ; $ n -- ; } return $ haystack ; }
Get the substring before the last occurence of a character
@param $haystack
@param $needle
@param int $n
@return string
Get the substring before the last occurence of a character