protected function getDotParts($string, $parts, $direction = 'ltr')
    {
        if ($direction == 'ltr') {
            return implode('.', array_slice(explode('.', $string), 0, $parts));
        } else {
            return implode('.', array_slice(explode('.', $string), (substr_count($string, '.') + 1) - $parts, $parts));
        }
    }
protected function getDotParts($string, $parts, $direction = 'ltr')
    {
        if ($direction == 'ltr') {
            return implode('.', array_slice(explode('.', $string), 0, $parts));
        } else {
            return implode('.', array_slice(explode('.', $string), (substr_count($string, '.') + 1) - $parts, $parts));
        }
    }
protected function getDotParts ( $ string , $ parts , $ direction = 'ltr' ) { if ( $ direction == 'ltr' ) { return implode ( '.' , array_slice ( explode ( '.' , $ string ) , 0 , $ parts ) ) ; } else { return implode ( '.' , array_slice ( explode ( '.' , $ string ) , ( substr_count ( $ string , '.' ) + 1 ) - $ parts , $ parts ) ) ; } }
Returns a part of the input string splitted by count of dots from left or right.

@param string $string    The string to split
@param int    $parts     The count of parts to return
@param string $direction The direction for processing. Can be either LTR or RTL.

@author Benjamin Carl <opensource@clickalicious.de>

@return string The resulting String
Returns a part of the input string splitted by count of dots from left or right .