public static function substringBefore($string, $separator)
    {
        $pos = mb_strpos($string, $separator);
        return $pos !== false ? mb_substr($string, 0, $pos) : $string;
    }
public static function substringBefore($string, $separator)
    {
        $pos = mb_strpos($string, $separator);
        return $pos !== false ? mb_substr($string, 0, $pos) : $string;
    }
public static function substringBefore ( $ string , $ separator ) { $ pos = mb_strpos ( $ string , $ separator ) ; return $ pos !== false ? mb_substr ( $ string , 0 , $ pos ) : $ string ; }
Gets the substring before the first occurrence of a separator. The separator is not returned.

@param string $string
@param string $separator
@return string
Gets the substring before the first occurrence of a separator . The separator is not returned .