hi,
i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:
<?php
function week_of_year($month, $day, $year) {
$day_of_year = date('z', mktime(0, 0, 0, $month, $day, $year));
/* Days in the week before Jan 1. If you want weeks to start on Monday make this (x + 6) % 7 */
$days_before_year = date('w', mktime(0, 0, 0, 1, 1, $year));
$days_left_in_week = 7 - date('w', mktime(0, 0, 0, $month, $day, $year));
/* find the number of weeks by adding the days in the week before the start of the year, days up to $day, and the days left in this week, then divide by 7 */
return ($days_before_year + $day_of_year + $days_left_in_week) / 7;
}
?>
so if i go : week_of_year(1, 3, 2010) (sunday)
the week shows as 1, because the script is set to begin new week on sunday,
however i am confused by his instruction " (x + 6) % 7 " to have the week start on a monday
what part of the script do i apply this equation ???
thanks
How can I Compare two xml documents?
Hi all,
SESSION question
I am building an application , a directory for auctions.For SEO i made a script which copies a php file to all the directories paths that it creates.I made it work and into all the php files into each
Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will be multi-user. I've got the multi-deck shoe and dealing table done and other parts rough coded. What
Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i would like to update a particular field in my db.however no matter how hard i try to the code seem to
Warning: Cannot modify header information - headers already sent by (output sta
Warning: Cannot modify header information - headers already sent by (output started at /home/praylife/public_html/index.php:29) in /home/praylife/public_html/index.php on line 188Warning: Cannot
Click counter to ignore traffic from search bots
I have a click counter on my site that...well, counts the number of clicks a link gets on the frontpage. It's a good system, but it's got a few flaws, an example being that it counts
RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to also post other articles that don't have a feed. Is there a legal/respectable way to harvest and post
Why is this function returning a false value when it shouldn't be??
This is in an include file. I want it to check a value in an html form and see if it's just white space, is numbers, is empty etc.Code: (text) [Select]<?phpfunction
How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
RadioButtonList item spacing
I have a RadioButtonList and I can't put any spacing between the items. They are arranged vertically, and each one is right on top of the next.