show week number on calendar

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

show week number on calendar

Post by amir »

i have coded a calendar and i am trying to add the week number for each week down the side.

i have the days (S, M, T ... S) across the top and then im showing the dates underneath that <td> tag.

i know how to get the current week number: date('W'), but i am not sure how to get the current week number for each week and display it on my calendar...

here is my calendar so you can see my layout. in the blank boxs on the left is where i want to display the week number.

http://www.ukpegasus.co.uk/ellandrd/cal

this calendar only shows current month...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Give date() a timestamp in that week. Note that the second argument is a timestamp. These can be produced from time(), strtotime(), mktime() among other functions found in php.
Post Reply