Re: week of example code
| From: | jeremy brand | Date: | Mon, 08 Jan 2001 23:00:19 +0000 |
| Subject: | Re: week of example code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33339@lists.php.net to get a copy of this message | ||
why not this?
$year = date('Y');
$month = date('m');
$day = (int)date('d');
if ($day >= 1 && $day < 8)
$week = 1;
else if ($day >= 8 && $day < 15)
$week = 2;
else if ($day >= 15 && $day < 22)
$week = 3;
else if ($day >= 22 && $day < 29)
$week = 4;
else if ($day >= 29)
$week = 5;
print "$year_$month_$week";
Jeremy
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com
On Mon, 8 Jan 2001, enthalpy wrote:
> Date: Mon, 8 Jan 2001 16:35:10 -0600 (CST)
> From: enthalpy <enthalpy@core.com>
> To: php-general@lists.php.net
> Subject: [PHP] week of example code
>
>
> im looking for some example code that will print out what week of the
> month it is in this format
>
> year_month_week
>
> ive attempted this on my own with no success.
>
> <-----CoreComm-Internet-Services--http://core.com/----->
> (Jon Marshall CoreComm Services Chicago)
> (jonathon.marshall@core.com Systems Engineer II)
> (enthalpy@core.com Network Operations)
> <-----Enthalpy.org------------http://enthalpy.org/----->
> (enthalpy@enthalpy.org The World of Nothing)
> <------------------------------------------------------>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>