我的交互式地图标记基于XML / PHP。
标记会根据数据库上的时间与当前时间进行动态更改。当我在数据库上设置了几个小时但是当我把时间和天数都放在不工作时它的工作......任何想法?
工作示例:
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
$openingHours = explode(";", $row['openingHours']);
$currentTime = date('H');
if (in_array($currentTime, $openingHours)) {
$status = 'Open';
}
else {
$status = 'Closed';
}
但是这个不起作用:
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
$days = explode(";", $row['days']);
$openingHours = explode(";", $row['openingHours']);
$currentTime = date('D:H');
if (in_array($currentTime, $days, $openingHours)) {
$status = 'Open';
}
else {
$status = 'Closed';
}