目前,当时间戳被回显时,它看起来像这样
function show_posts($userid){
$posts = array();
$sql = "select body, stamp from posts where user_id = '$userid' order by stamp desc";
$result = mysql_query($sql);
while($data = mysql_fetch_object($result)){
$posts[] = array( 'stamp' => $data->stamp,
'userid' => $userid,
'body' => $data->body
);
}
return $posts;
}
我想拿这张邮票改变它而不是打印2012-03-26 12:07:52 它将打印下面的时间,然后是下面的时间,我将如何在我的网页上显示它。
<?php
foreach ($posts as $key => $list){
echo "<tr valign='top'>\n";
echo "<td>".$list['userid'] ."</td>\n";
echo "<td>".$list['body'] ."<br/>\n";
echo "<small>".$list['stamp']."<br/>\n <a>Like</a> <a>Flag</a><hr class='span9'/></small></td>\n";
echo "</tr>\n";
}
?>