是否可以在echo语句中回显?
我有一个if语句,如果满足时间条件,则回显HTML元素。我想回应echo $ rows [' SOMETHING'];在这个回声中。所以...
if ($whatdayisit === Monday && $gmt <= $rows['opening_monday_to'] && $gmt >= $rows['opening_monday_from'])
{
echo'<div class="opening_times_times_orange"> ***** echo $rows['opening_monday_from'] . " " . "-" . " " $rows['opening_monday_to'] ***** </div>';
}
else echo '<div class="opening_times_times_red">***** echo $rows['opening_monday_from'] . " " . "-" . " " $rows['opening_monday_to'] ***** </div>';
?>
我想回应*****之间的什么,但它不允许我使用当前的脚本。
我如何解决此问题
if ($whatdayisit === Monday && $gmt <= $rows['opening_monday_to'] && $gmt >= $rows['opening_monday_from'])
{
echo'<div class="opening_times_times_orange"> HERE </div>';
}
else echo '<div class="opening_times_times_red"> HERE </div>';
HERE(1)echo $rows['opening_monday_from'];
和echo $rows['opening_monday_to'];
这里(2)echo $rows['opening_monday_from'];
和echo $rows['opening_monday_to'];
答案 0 :(得分:0)
试试这个: -
if ($whatdayisit === Monday && $gmt <= $rows['opening_monday_to'] && $gmt >= $rows['opening_monday_from'])
{
echo'<div class="opening_times_times_orange"> *****'. $rows['opening_monday_from']. " " . "-" . " ".$rows['opening_monday_to'].' ***** </div>';
}
else echo '<div class="opening_times_times_red">*****'.$rows['opening_monday_from'] . " " . "-" . " " .$rows['opening_monday_to'].' ***** </div>';
?>