本文整理匯總了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;
}