src/Utilities/Miscellaneous.php
public static function getLastElementOfString($string, $separator)
    {
        $elements = self::getStringElements($string, $separator);

        /*
         * No elements?
         * Nothing to do
         */
        if (empty($elements)) {
            return null;
        }

        $element = Arrays::getLastElement($elements);

        return trim($element);
    }
public static function getLastElementOfString($string, $separator)
    {
        $elements = self::getStringElements($string, $separator);

        /*
         * No elements?
         * Nothing to do
         */
        if (empty($elements)) {
            return null;
        }

        $element = Arrays::getLastElement($elements);

        return trim($element);
    }
public static function getLastElementOfString ( $ string , $ separator ) { $ elements = self :: getStringElements ( $ string , $ separator ) ; /*
         * No elements?
         * Nothing to do
         */ if ( empty ( $ elements ) ) { return null ; } $ element = Arrays :: getLastElement ( $ elements ) ; return trim ( $ element ) ; }
Returns the last element of given string divided by given separator

@param string $string    The string to check
@param string $separator The separator which divides elements of string
@return null|string
Returns the last element of given string divided by given separator