note 52554 added to function.date

From: Date: Thu, 05 May 2005 15:17:02 +0000
Subject: note 52554 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-88966@lists.php.net to get a copy of this message
/** * 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 = 53; 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); } } return $result; } ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52554 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52554&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52554&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52554&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52554&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52554&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52554&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88966) next »