【发布时间】:2016-12-31 03:28:36
【问题描述】:
我正在尝试向使用 php 文件导出的 csv 添加一列。
post_date 的底部是我在提交/wordpress 帖子时需要知道正确字符串的部分。我目前在那里有一个默认日期请求,但这只是当前时间,而不是发布时间。您如何才能真正获得帖子的发布日期?非常感谢您的帮助!
$surveyArray = array(
'id' => $survey_id,
'title' => $survey_title,
'airline' => $airlineName,
'meal' => $mealName,
'test_great' => $get_test_great[0],
'fair_price' => $get_fair_price[0],
'friendly_host' => $get_friendly_host[0],
'right_temp' => $get_right_temp[0],
'looked_good' => $get_looked_good[0],
'would_reorder' => $get_would_reorder[0],
'comment' => $get_comment[0],
'airlane_race_number' => $get_airlane_race_number[0],
'post_date' => $postdate = date ("Y-m-d H:i:s"),
);
$allAirlinesAndAnswersInArray[] = $surveyArray;
}
【问题讨论】:
-
检查this
-
所以你想要 wordpress 帖子的创建日期?
-
是的,发布日期,而不是当前时间。我已经检查了这些链接,但不确定如何将它们集成到字符串中,因为当我将它们放入错误并说它必须是字符串时。感谢您的快速回复!真的很感激!
标签: php database string wordpress