Zum Beispiel so?
<?
$BrauneTonne = array("23.02.10", "9.03.10", "23.03.10", "6.04.10", "20.04.10", "4.05.10", "18.05.10", "31.05.10", "7.06.10", "15.06.10", "21.06.10", "29.06.10", "5.07.10", "13.07.10", "19.07.10", "27.07.10", "2.08.10", "10.08.10", "16.08.10", "24.08.10", "7.09.10", "21.09.10", "5.10.10", "19.10.10", "2.11.10", "16.11.10", "30.11.10", "14.12.10", "28.12.10");
$TermineMuellTonne = array("16.02.10", "2.03.10", "16.03.10", "30.03.10", "13.04.10", "27.04.10", "11.05.10", "26.05.10", "8.06.10", "22.06.10", "6.07.10", "20.07.10", "3.08.10", "17.08.10", "31.08.10", "14.09.10", "28.09.10", "12.10.10", "26.10.10", "9.11.10", "23.11.10", "7.12.10", "31.08.12");
$GelberSack = array("11.03.10", "9.04.10", "6.05.10", "1.06.10", "1.07.10", "15.07.10", "29.07.10", "12.08.10", "26.08.10", "9.9.10", "23.09.10", "21.10.10", "18.11.10", "16.12.10");
$Alt = array("8.03.10", "6.04.10", "4.05.10", "8.06.10", "6.07.10", "3.08.10", "1.09.10", "1.10.10", "5.11.10", "2.12.10");
foreach($TermineMuellTonne as $date)
{
if(strtotime("20".substr($date, 6, 2)."-".substr($date, 3, 2)."-".substr($date, 0, 2)) >= time())
{
SetValueString(CreateVariableByName($IPS_SELF, "Datum Mülltonne", 3), $date);
break;
}
}
foreach($BrauneTonne as $date)
{
if(strtotime("20".substr($date, 6, 2)."-".substr($date, 3, 2)."-".substr($date, 0, 2)) >= time())
{
SetValueString(CreateVariableByName($IPS_SELF, "Datum Braune Tonne", 3), $date);
break;
}
}
foreach($GelberSack as $date)
{
if(strtotime("20".substr($date, 6, 2)."-".substr($date, 3, 2)."-".substr($date, 0, 2)) >= time())
{
SetValueString(CreateVariableByName($IPS_SELF, "Datum GelberSack", 3), $date);
break;
}
}
foreach($Alt as $date)
{
if(strtotime("20".substr($date, 6, 2)."-".substr($date, 3, 2)."-".substr($date, 0, 2)) >= time())
{
SetValueString(CreateVariableByName($IPS_SELF, "Datum Altpapier", 3), $date);
break;
}
}
function CreateVariableByName($id, $name, $type)
{
global $IPS_SELF;
$vid = @IPS_GetVariableIDByName($name, $id);
if($vid===false) {
$vid = IPS_CreateVariable($type);
IPS_SetParent($vid, $id);
IPS_SetName($vid, $name);
IPS_SetInfo($vid, "this variable was created by script #$IPS_SELF");
}
return $vid;
}
?>