public function isPlainText()
    {
        $sc_pos = strpos($this->mime_type, ';');
        if ($sc_pos !== false)
            $mime_type = substr($this->mime_type, 0, $sc_pos);
        else
            $mime_type = $this->mime_type;
        
        // Some application/* types are plain text
        switch ($mime_type)
        {
            case "application/javascript":
            case "application/json":
            case "application/xml":
                return true;
        }

        // Assume all text/* files to be plain text
        return substr($mime_type, 0, 5) === "text/";
    }
public function isPlainText()
    {
        $sc_pos = strpos($this->mime_type, ';');
        if ($sc_pos !== false)
            $mime_type = substr($this->mime_type, 0, $sc_pos);
        else
            $mime_type = $this->mime_type;
        
        // Some application/* types are plain text
        switch ($mime_type)
        {
            case "application/javascript":
            case "application/json":
            case "application/xml":
                return true;
        }

        // Assume all text/* files to be plain text
        return substr($mime_type, 0, 5) === "text/";
    }
public function isPlainText ( ) { $ sc_pos = strpos ( $ this -> mime_type , ';' ) ; if ( $ sc_pos !== false ) $ mime_type = substr ( $ this -> mime_type , 0 , $ sc_pos ) ; else $ mime_type = $ this -> mime_type ; // Some application/* types are plain text switch ( $ mime_type ) { case "application/javascript" : case "application/json" : case "application/xml" : return true ; } // Assume all text/* files to be plain text return substr ( $ mime_type , 0 , 5 ) === "text/" ; }
Check if a mime type is plain text
@param string $mime The Mime type
@return bool True if the mime type is plaintext, false if it isn't
Check if a mime type is plain text