echo "<p>These are the available venues for $date that also have the catering
grade of <b>$catering_grade </b> </p>";
这就是它的结果:
这些是 2014-05-13 的可用场地,其餐饮等级为3
如何在回声中将格式更改为DD / MM / YYYY?
答案 0 :(得分:0)
你需要
$originalDate = "2014-05-13";
$newDate = date("d-m-Y", strtotime($originalDate));
所以在你的视图中
<?php
echo "<p>These are the available
venues for " . date("d-m-Y", strtotime($date)) . " that
also have the catering
grade of <b>$catering_grade </b> </p>";
?>
答案 1 :(得分:0)
date("d/m/Y", strtotime($date));
OR
$date = '2010-05-13';
$date = str_replace('-', '/', $date);
echo date('d-m-Y', strtotime($date));