当前位置: 首页>>代码示例>>PHP>>正文


PHP Mail_mimeDecode::getMimeNumbers方法代码示例

本文整理汇总了PHP中Mail_mimeDecode::getMimeNumbers方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail_mimeDecode::getMimeNumbers方法的具体用法?PHP Mail_mimeDecode::getMimeNumbers怎么用?PHP Mail_mimeDecode::getMimeNumbers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mail_mimeDecode的用法示例。


在下文中一共展示了Mail_mimeDecode::getMimeNumbers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: decode_structure

                $filename = $message_data->date . '/' . $message_id . '/message';
                break;
        }
        if (!@file_exists($quarantine_dir . '/' . $filename)) {
            die("Error: file not found\n");
        }
        $file = file_get_contents($quarantine_dir . '/' . $filename);
    }
}
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$params['input'] = $file;
$Mail_mimeDecode = new Mail_mimeDecode($file);
$structure = $Mail_mimeDecode->decode($params);
$mime_struct = $Mail_mimeDecode->getMimeNumbers($structure);
// Make sure that part being requested actually exists
if (isset($_GET['part'])) {
    if (!isset($mime_struct[$_GET['part']])) {
        die("Part " . sanitizeInput($_GET['part']) . " not found\n");
    }
}
function decode_structure($structure)
{
    $type = $structure->ctype_primary . "/" . $structure->ctype_secondary;
    switch ($type) {
        case "text/plain":
            /*
            if (isset ($structure->ctype_parameters['charset']) &&
                strtolower($structure->ctype_parameters['charset']) == 'utf-8'
            ) {
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:31,代码来源:viewpart.php

示例2: array

 /**
  * Given the output of the above function, this will return an
  * array of references to the parts, indexed by mime number.
  *
  * @param  object $structure   The structure to go through
  * @param  string $mime_number Internal use only.
  * @return array               Mime numbers
  */
 function &getMimeNumbers(&$structure, $no_refs = false, $mime_number = '', $prepend = '')
 {
     $return = array();
     if (!empty($structure->parts)) {
         if ($mime_number != '') {
             $structure->mime_id = $prepend . $mime_number;
             $return[$prepend . $mime_number] =& $structure;
         }
         for ($i = 0; $i < count($structure->parts); $i++) {
             if (!empty($structure->headers['content-type']) and substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
                 $prepend = $prepend . $mime_number . '.';
                 $_mime_number = '';
             } else {
                 $_mime_number = $mime_number == '' ? $i + 1 : sprintf('%s.%s', $mime_number, $i + 1);
             }
             $arr =& Mail_mimeDecode::getMimeNumbers($structure->parts[$i], $no_refs, $_mime_number, $prepend);
             foreach ($arr as $key => $val) {
                 $no_refs ? $return[$key] = '' : ($return[$key] =& $arr[$key]);
             }
         }
     } else {
         if ($mime_number == '') {
             $mime_number = '1';
         }
         $structure->mime_id = $prepend . $mime_number;
         $no_refs ? $return[$prepend . $mime_number] = '' : ($return[$prepend . $mime_number] =& $structure);
     }
     return $return;
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:37,代码来源:mimeDecode.php


注:本文中的Mail_mimeDecode::getMimeNumbers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。