I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = October
$third_sunday = CalculateThirdSunday(October)
if ( ( TodaysDate before $third_sunday ) | ( TodaysDate == $third_sunday )
do something
else CalculateThirdSunday(November)
do something else
So the sorta pseudo-code above should reveal that I want a function that will always take the current month and calculate the third Sunday. Then if it's on or before that third sunday do something. However if it is after the the third Sunday, then we will calculate the third sunday of next month and then do something.
I can calculate what the third sunday out from now() is quite trivially:
<?PHP echo date('l jS F (Y-m-d)', strtotime('third Sunday')); ?>
But anyone got any idea how to find the third sunday from the beginning of the month? I tried something like
<?PHP echo date('l jS F (Y-m-d)', strtotime('2009-10-01 +third Sunday')); ?>
but that appears to not work. It tells me the next sunday is in Feb
form help
this doesn't work. i want the form action to go the location.href of the submit button chosen.. how do i do this?Code: <?php echo "<form enctype='multipart/form-data'
some query on multilingual website
Hi all,Which is the simplest and easiest method to make a website multilingual,is it putting files in different folder for different languages? or something else ?any suggestions will be
Nested (echoed) php running wrong script
Got a problem with a php website I'm creating.In a nutshell, the first page is entirely html and calls a php script to process an uploaded file and some form fields using POST. After validating the
Navigation include for all site directories
Hi,I need a navigation include that can deal with directories at different levels on a site. All I can seem to find are the basic includes for files all in the same directory. This doesn't work for me
array empty
Hiya peeps,Ok here is the codes.order.phpCode: <?php if(!isset($_POST) OR empty($_POST)) { echo
Help with PHP Calendar code...
Hello, I'm new to this forum and I'm glad I found it.I wrote this code for a PHP calendar as an assignment for college.It works fine, but I also want today's day to show in another color and I can't
Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this Hope that anyone could give me a simple .htaccess tutorialthanks
what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %s\r\n", $name);what does %s means ?
Form always sends to error page...
Hello,Any help will be greatly appreciated. I am having trouble getting multiple fields to be required, and with the if multiple errors section. I think that's where the problem is. When I click
Validating time
Hi Guyswhat do you think of the following approach to validate a 24hour time:http://snipplr.com/view/23007/validate-time/Are there any better approaches ?