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
Multi Dimensional Array Append
Hi Guys I have a function that returns a multidimentional array eg $result = function(param)echo $result[0][1]." ".$result[1][1]but I want to call the function 4 diffrent times and append to
InternetOpenUrl() Invalid cert
Hi all,
DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This is mostly fine but one problem I have is when I do this:Code:
Coding question?
Hey guys, I have a quick question. If I want to make a way for people to pay for health in my game, how would I go about coding that? Would be like this?Code: ($purchace = 1000000) ==
Unable to customise toolbar in FCK
<FCKeditorV2:FCKeditor ID="FCKQuesreply" runat="server" ToolbarSet="MyToolbar" BasePath="~/fckeditor/" SkinPath="skins/silver/" CustomConfigurationsPath="~/fckeditor/fckconfig.js"
Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to remove the last comma from the string and can't seem to remove it. I have tried chop, rtrim, substr,
Select question
Hi,First I would like to say that php is pretty new for me.. so please don't shoot me if this should be a stupid question!But I'm a little surpized due to following..I have a search script (very large
C++ API to Oracle dB
I need to perform a select command to the Oracle dB to obtain information from a table.What libraries can I link into my project to make this work?I read about the OCI - but I cannot find any
download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a directory on the server into a directory on the local C drive.I started out like this :Code:
need help with mail()
hi i want to send an email with attaching pdf file using php. i have the following script but the problem with this is when i send an attachment it does to the specified address but that email is