splitHeaderField example



    /** * split a content type in its different parts * * @param string $type content-type * @param string $wantedPart the wanted part, else an array with all parts is returned * @return string|array wanted part or all parts as array('type' => content-type, partname => value) */
    public static function splitContentType($type$wantedPart = null)
    {
        return self::splitHeaderField($type$wantedPart, 'type');
    }

    /** * split a header field like content type in its different parts * * @param string $type header field * @param string $wantedPart the wanted part, else an array with all parts is returned * @param string $firstName key name for the first part * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value) * @throws Zend_Exception */
    

    public function getHeaderField($name$wantedPart = 0, $firstName = 0) {
        return Zend_Mime_Decode::splitHeaderField(current($this->getHeader($name, 'array'))$wantedPart$firstName);
    }


    /** * Getter for mail headers - name is matched in lowercase * * This getter is short for Zend_Mail_Part::getHeader($name, 'string') * * @see Zend_Mail_Part::getHeader() * * @param string $name header name * @return string value of header * @throws Zend_Mail_Exception */
Home | Imprint | This part of the site doesn't use cookies.