當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FeedDate::v0002方法代碼示例

本文整理匯總了PHP中FeedDate::v0002方法的典型用法代碼示例。如果您正苦於以下問題:PHP FeedDate::v0002方法的具體用法?PHP FeedDate::v0002怎麽用?PHP FeedDate::v0002使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FeedDate的用法示例。


在下文中一共展示了FeedDate::v0002方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createFeed

 /**
  * Builds the MBOX contents.
  * @return    string    the feed's complete text 
  */
 function createFeed()
 {
     $feed = '';
     for ($i = 0; $i < count($this->items); $i++) {
         if ($this->items[$i]->author != "") {
             $from = $this->items[$i]->author;
         } else {
             $from = $this->title;
         }
         $itemDate = new FeedDate($this->items[$i]->date);
         $feed .= "From " . strtr(MBOX::qp_enc($from), " ", "_") . " " . $itemDate->v0002() . "\n";
         $feed .= "Content-Type: text/plain;\n";
         $feed .= "\tcharset=\"" . $this->encoding . "\"\n";
         $feed .= "Content-Transfer-Encoding: quoted-printable\n";
         $feed .= "Content-Type: text/plain\n";
         $feed .= "From: \"" . MBOX::qp_enc($from) . "\"\n";
         $feed .= "Date: " . $itemDate->rfc822() . "\n";
         $feed .= "Subject: " . MBOX::qp_enc(FeedCreator::iTrunc($this->items[$i]->title, 100)) . "\n";
         $feed .= "\n";
         $body = chunk_split(MBOX::qp_enc($this->items[$i]->description));
         $feed .= preg_replace("~\nFrom ([^\n]*)(\n?)~", "\n>From \$1\$2\n", $body);
         $feed .= "\n";
         $feed .= "\n";
     }
     return $feed;
 }
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:30,代碼來源:mbox.inc.php


注:本文中的FeedDate::v0002方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。