private function _cutNameTail( array $prefix, $string )
	{
		$result = array();
		$noprefix = true;
		$strlen = strlen( $string );
		$sep = $this->_getKeySeparator();

		foreach( $prefix as $key )
		{
			$len = strlen( $key );

			if( strncmp( $string, $key, $len ) === 0 )
			{
				if( $strlen > $len && ( $pos = strrpos( $string, $sep ) ) !== false )
				{
					$result[] = $string = substr( $string, 0, $pos );
					$result = array_merge( $result, $this->_cutNameTail( $prefix, $string ) );
				}

				$noprefix = false;
				break;
			}
		}

		if( $noprefix )
		{
			if( ( $pos = strrpos( $string, $sep ) ) !== false ) {
				$result[] = substr( $string, 0, $pos );
			} else {
				$result[] = $string;
			}
		}

		return $result;
	}
private function _cutNameTail( array $prefix, $string )
	{
		$result = array();
		$noprefix = true;
		$strlen = strlen( $string );
		$sep = $this->_getKeySeparator();

		foreach( $prefix as $key )
		{
			$len = strlen( $key );

			if( strncmp( $string, $key, $len ) === 0 )
			{
				if( $strlen > $len && ( $pos = strrpos( $string, $sep ) ) !== false )
				{
					$result[] = $string = substr( $string, 0, $pos );
					$result = array_merge( $result, $this->_cutNameTail( $prefix, $string ) );
				}

				$noprefix = false;
				break;
			}
		}

		if( $noprefix )
		{
			if( ( $pos = strrpos( $string, $sep ) ) !== false ) {
				$result[] = substr( $string, 0, $pos );
			} else {
				$result[] = $string;
			}
		}

		return $result;
	}
private function _cutNameTail ( array $ prefix , $ string ) { $ result = array ( ) ; $ noprefix = true ; $ strlen = strlen ( $ string ) ; $ sep = $ this -> _getKeySeparator ( ) ; foreach ( $ prefix as $ key ) { $ len = strlen ( $ key ) ; if ( strncmp ( $ string , $ key , $ len ) === 0 ) { if ( $ strlen > $ len && ( $ pos = strrpos ( $ string , $ sep ) ) !== false ) { $ result [ ] = $ string = substr ( $ string , 0 , $ pos ) ; $ result = array_merge ( $ result , $ this -> _cutNameTail ( $ prefix , $ string ) ) ; } $ noprefix = false ; break ; } } if ( $ noprefix ) { if ( ( $ pos = strrpos ( $ string , $ sep ) ) !== false ) { $ result [ ] = substr ( $ string , 0 , $ pos ) ; } else { $ result [ ] = $ string ; } } return $ result ; }
Cuts the last part separated by a dot repeatedly and returns the list of resulting string.

@param array $prefix Required base prefixes of the search keys
@param string $string String containing parts separated by dots
@return array List of resulting strings
Cuts the last part separated by a dot repeatedly and returns the list of resulting string .