protected function getNextTag()
    {
        $tagLetter = substr( $this->currentTag, 0, 1 );
        $tagNumber = intval( substr( $this->currentTag, 1 ) );
        $tagNumber++;
        if ( $tagLetter == 'Z' && $tagNumber == 10000 )
        {
            $tagLetter = 'A';
            $tagNumber = 1;
        }
        if ( $tagNumber == 10000 )
        {
            $tagLetter++;
            $tagNumber = 0;
        }
        $this->currentTag = $tagLetter . sprintf( "%04s", $tagNumber );
        return $this->currentTag;
    }
protected function getNextTag()
    {
        $tagLetter = substr( $this->currentTag, 0, 1 );
        $tagNumber = intval( substr( $this->currentTag, 1 ) );
        $tagNumber++;
        if ( $tagLetter == 'Z' && $tagNumber == 10000 )
        {
            $tagLetter = 'A';
            $tagNumber = 1;
        }
        if ( $tagNumber == 10000 )
        {
            $tagLetter++;
            $tagNumber = 0;
        }
        $this->currentTag = $tagLetter . sprintf( "%04s", $tagNumber );
        return $this->currentTag;
    }
protected function getNextTag ( ) { $ tagLetter = substr ( $ this -> currentTag , 0 , 1 ) ; $ tagNumber = intval ( substr ( $ this -> currentTag , 1 ) ) ; $ tagNumber ++ ; if ( $ tagLetter == 'Z' && $ tagNumber == 10000 ) { $ tagLetter = 'A' ; $ tagNumber = 1 ; } if ( $ tagNumber == 10000 ) { $ tagLetter ++ ; $ tagNumber = 0 ; } $ this -> currentTag = $ tagLetter . sprintf ( "%04s" , $ tagNumber ) ; return $ this -> currentTag ; }
Generates the next IMAP tag to prepend to client commands.

The structure of the IMAP tag is Axxxx, where:
- A is a letter (uppercase for conformity)
- x is a digit from 0 to 9

example of generated tag: T5439

It uses the class variable $this->currentTag.

Everytime it is called, the tag increases by 1.

If it reaches the last tag, it wraps around to the first tag.

By default, the first generated tag is A0001.

@return string
Generates the next IMAP tag to prepend to client commands .