<?php
date_default_timezone_set('Europe/Berlin');
setlocale(LC_TIME, 'de_DE');
$timestamp = strtotime('monday this week');
$holidays = array('Sonntag 17.04.','Dienstag 19.04.','Mittwoch 20.04.');
$enHolidays = array_map('daysToEn',$holidays);
$days = array();
for ($i = 0; $i < 14; $i++) :
$days[] = strftime('%A %d.%m.', $timestamp);
$timestamp = strtotime('+1 day', $timestamp);
endfor;
foreach($days AS $day) :
if (in_array($day, $enHolidays)) :
echo daysToDe($day) . ' is a holiday and ' . daysToDe(strftime('%A', strtotime($day))) . '<br />';
else :
echo $day . '<br />';
endif;
endforeach;
function daysToEn($dayName) {
$engDays = array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
$duDays = array('Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag');
return str_replace($duDays,$engDays,$dayName);
}
function daysToDe($dayName) {
$engDays = array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
$duDays = array('Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag');
return str_replace($engDays,$duDays,$dayName);
}
由于某种原因,control.enabled根本没有变化。 我无法理解为什么:(,我可以接受任何建议而不是EnableControls功能。 谢谢你的帮助:)
答案 0 :(得分:0)
嗯,你有一个逻辑问题,看看你在做什么:
因此...