protected function _removeSubjLeader(&$str, $keepblob = false)
    {
        $ret = false;

        if (!strlen($str)) {
            return $ret;
        }

        if ($len = strspn($str, " \t")) {
            $str = substr($str, $len);
            $ret = true;
        }

        $i = 0;

        if (!$keepblob) {
            while (isset($str[$i]) && ($str[$i] === '[')) {
                if (($i = $this->_removeBlob($str, $i)) === false) {
                    return $ret;
                }
            }
        }

        if (stripos($str, 're', $i) === 0) {
            $i += 2;
        } elseif (stripos($str, 'fw', $i) === 0) {
            $i += (stripos($str, 'fwd', $i) === 0) ? 3 : 2;
        } else {
            return $ret;
        }

        $i += strspn($str, " \t", $i);

        if (!$keepblob) {
            while (isset($str[$i]) && ($str[$i] === '[')) {
                if (($i = $this->_removeBlob($str, $i)) === false) {
                    return $ret;
                }
            }
        }

        if (!isset($str[$i]) || ($str[$i] !== ':')) {
            return $ret;
        }

        $str = substr($str, ++$i);

        return true;
    }
protected function _removeSubjLeader(&$str, $keepblob = false)
    {
        $ret = false;

        if (!strlen($str)) {
            return $ret;
        }

        if ($len = strspn($str, " \t")) {
            $str = substr($str, $len);
            $ret = true;
        }

        $i = 0;

        if (!$keepblob) {
            while (isset($str[$i]) && ($str[$i] === '[')) {
                if (($i = $this->_removeBlob($str, $i)) === false) {
                    return $ret;
                }
            }
        }

        if (stripos($str, 're', $i) === 0) {
            $i += 2;
        } elseif (stripos($str, 'fw', $i) === 0) {
            $i += (stripos($str, 'fwd', $i) === 0) ? 3 : 2;
        } else {
            return $ret;
        }

        $i += strspn($str, " \t", $i);

        if (!$keepblob) {
            while (isset($str[$i]) && ($str[$i] === '[')) {
                if (($i = $this->_removeBlob($str, $i)) === false) {
                    return $ret;
                }
            }
        }

        if (!isset($str[$i]) || ($str[$i] !== ':')) {
            return $ret;
        }

        $str = substr($str, ++$i);

        return true;
    }
protected function _removeSubjLeader ( & $ str , $ keepblob = false ) { $ ret = false ; if ( ! strlen ( $ str ) ) { return $ ret ; } if ( $ len = strspn ( $ str , " \t" ) ) { $ str = substr ( $ str , $ len ) ; $ ret = true ; } $ i = 0 ; if ( ! $ keepblob ) { while ( isset ( $ str [ $ i ] ) && ( $ str [ $ i ] === '[' ) ) { if ( ( $ i = $ this -> _removeBlob ( $ str , $ i ) ) === false ) { return $ ret ; } } } if ( stripos ( $ str , 're' , $ i ) === 0 ) { $ i += 2 ; } elseif ( stripos ( $ str , 'fw' , $ i ) === 0 ) { $ i += ( stripos ( $ str , 'fwd' , $ i ) === 0 ) ? 3 : 2 ; } else { return $ ret ; } $ i += strspn ( $ str , " \t" , $ i ) ; if ( ! $ keepblob ) { while ( isset ( $ str [ $ i ] ) && ( $ str [ $ i ] === '[' ) ) { if ( ( $ i = $ this -> _removeBlob ( $ str , $ i ) ) === false ) { return $ ret ; } } } if ( ! isset ( $ str [ $ i ] ) || ( $ str [ $ i ] !== ':' ) ) { return $ ret ; } $ str = substr ( $ str , ++ $ i ) ; return true ; }
Remove all prefix text of the subject that matches the subj-leader
ABNF.

@param string &$str       The subject string.
@param boolean $keepblob  Remove blob information?

@return boolean  True if string was altered.
Remove all prefix text of the subject that matches the subj - leader ABNF .