private static function _getTreeElm($str, &$info)
    {
        /*
         * Normalize the string.
         */
        $str = preg_replace('/(\n\r|\n|\r|\s)+/', ' ', $str);

        /*
         * Identify it by checking its first symbols.
         */
        if (strpos($str, '</') === 0) {
            return 'end';
        } elseif (strpos($str, '<!') === 0) {
            return 'content';
        } elseif (strpos($str, '<!--') === 0) {
            return 'comment';
        } elseif (strpos($str, '<') === 0) {
            preg_match('/<([a-zA-Z0-9]+)(.*?(?=\/>|>))(\/>|>)+/', $str, $info);

            return 'start';
        }

        return 'content';
    }
private static function _getTreeElm($str, &$info)
    {
        /*
         * Normalize the string.
         */
        $str = preg_replace('/(\n\r|\n|\r|\s)+/', ' ', $str);

        /*
         * Identify it by checking its first symbols.
         */
        if (strpos($str, '</') === 0) {
            return 'end';
        } elseif (strpos($str, '<!') === 0) {
            return 'content';
        } elseif (strpos($str, '<!--') === 0) {
            return 'comment';
        } elseif (strpos($str, '<') === 0) {
            preg_match('/<([a-zA-Z0-9]+)(.*?(?=\/>|>))(\/>|>)+/', $str, $info);

            return 'start';
        }

        return 'content';
    }
private static function _getTreeElm ( $ str , & $ info ) { /*
         * Normalize the string.
         */ $ str = preg_replace ( '/(\n\r|\n|\r|\s)+/' , ' ' , $ str ) ; /*
         * Identify it by checking its first symbols.
         */ if ( strpos ( $ str , '</' ) === 0 ) { return 'end' ; } elseif ( strpos ( $ str , '<!' ) === 0 ) { return 'content' ; } elseif ( strpos ( $ str , '<!--' ) === 0 ) { return 'comment' ; } elseif ( strpos ( $ str , '<' ) === 0 ) { preg_match ( '/<([a-zA-Z0-9]+)(.*?(?=\/>|>))(\/>|>)+/' , $ str , $ info ) ; return 'start' ; } return 'content' ; }
Checks the type of the given tree element.

@param string $str   the current tree element
@param array  &$info additional info will be inserted here

@return string the type.
Checks the type of the given tree element .