本文整理汇总了PHP中FeedDate::unix方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedDate::unix方法的具体用法?PHP FeedDate::unix怎么用?PHP FeedDate::unix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedDate
的用法示例。
在下文中一共展示了FeedDate::unix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createFeed
/**
* Builds the MBOX contents.
* @return string the feed's complete text
*/
function createFeed()
{
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(MBOXCreator::qp_enc($from), " ", "_") . " " . date("D M d H:i:s Y", $itemDate->unix()) . "\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: \"" . MBOXCreator::qp_enc($from) . "\"\n";
$feed .= "Date: " . $itemDate->rfc822() . "\n";
$feed .= "Subject: " . MBOXCreator::qp_enc(FeedCreator::iTrunc($this->items[$i]->title, 100)) . "\n";
$feed .= "\n";
$body = chunk_split(MBOXCreator::qp_enc($this->items[$i]->description));
$feed .= preg_replace("~\nFrom ([^\n]*)(\n?)~", "\n>From \$1\$2\n", $body);
$feed .= "\n";
$feed .= "\n";
}
return $feed;
}