public static function rtrimWord($string, $word)
    {
        $end = mb_substr($string, 0-mb_strlen($word));
        if ($end != $word) {
            return $string;
        }
        return mb_substr($string, 0, mb_strlen($string)-mb_strlen($word));
    }
public static function rtrimWord($string, $word)
    {
        $end = mb_substr($string, 0-mb_strlen($word));
        if ($end != $word) {
            return $string;
        }
        return mb_substr($string, 0, mb_strlen($string)-mb_strlen($word));
    }
public static function rtrimWord ( $ string , $ word ) { $ end = mb_substr ( $ string , 0 - mb_strlen ( $ word ) ) ; if ( $ end != $ word ) { return $ string ; } return mb_substr ( $ string , 0 , mb_strlen ( $ string ) - mb_strlen ( $ word ) ) ; }
Trims a word out of a string

@param string $string
@param string $word

@return string
Trims a word out of a string