note 52560 deleted from function.date by aidan
| From: | aidan@php.net | Date: | Sun, 31 Jul 2005 12:34:48 +0000 |
| Subject: | note 52560 deleted from function.date by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92822@lists.php.net to get a copy of this message | ||
Note Submitter: memandeemail at gmail dot com
----
//bugfixes
/**
* Return the Struct of days in week of the year
*
* @param int $year
* @param string $str1
* @param string $str2
* @return array
*/
function weekstruct($year, $str1 = "de", $str2 = "ate") {
$result = array(); for ($iC=1;$iC <= 53; $iC++) $result[$iC] = null;
$ults = -1;
for ($dt = strtotime("$year-01-01") ; date("Y",$dt) == $year ; $dt =
strtotime("+1 day",$dt)) {
if (date('W',$dt) != $ults) {
//$result[$ults] .= " ".$str2." ".date("d/m",strtotime("-1
day",$dt));
$ults = date('W',$dt);
$result[$ults] = $str1." ".date("d/m",$dt)." ".$str2."
".date("d/m",strtotime("Sunday",$dt));
}
}
return $result;
}