欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php實現(xiàn)統(tǒng)計郵件大小的方法

 更新時間:2013年08月06日 08:50:11   作者:  
以下是對使用php實現(xiàn)統(tǒng)計郵件大小的方法進(jìn)行了分析介紹,需要的朋友可以過來參考下

統(tǒng)計用戶收件箱所占空間有多少,先計算每封郵件的大?。?biāo)題+內(nèi)容+附近),后總和;
1、計算附近大?。?BR>2、計算標(biāo)題和內(nèi)容大小
3、總和求出單封郵件大小
案例:

復(fù)制代碼 代碼如下:

<?php   
    $attach_size= 0;   
    if($attachmentid){  //獲取附近的大小   
        $attach_data= attachdata($attachmentid);   
        if($attach_data){   
            foreach($attach_dataas$value) {   
                $attach_size+= $value['filesize'];   
            }   
        }   
    }   
    //獲取標(biāo)題和郵件內(nèi)容的大小   
    $email_content_size= 0;   
    $_filename= "attachment/emailsizecalculate.tmp";   
    $_file= fopen($_filename, "wb");   
    fwrite($_file, $subject.$content);   
    fclose($_file);   
    if($_temp= filesize($_filename)){   
        $email_content_size= $_temp;   
    }   
    $del_ret= @unlink($_filename);   
    $sum_size= $attach_size*1024 + $email_content_size;  //郵件總大小          
?>

相關(guān)文章

最新評論