revo1059
asked on
Get the friday of a given week number
Hello
I need a way to find the friday for a week number in php. eg date("W") reports the week number of the current date. I need a way to take week 14 and tell what day friday would be for that week
I am using php 4 and mysql 5
I need a way to find the friday for a week number in php. eg date("W") reports the week number of the current date. I need a way to take week 14 and tell what day friday would be for that week
I am using php 4 and mysql 5
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
when you call the function, echo it browser as
echo getFriday(22,2006);
ASKER
I am what you would call a noob, that worked great. Thank you
ASKER
I tried your code, and the page just displays blank.
this is my exact code
<?php
function getFriday($wk,$yr) {
$wk = $wk-1;
$stday = strtotime($wk.' week',mktime(0,0,0,1,1,$yr
$wk_num = date("w",$stday);
$add_day = (5-$wk_num);
$friday_date = date("Y-m-d",mktime(0,0,0,
return $friday_date;
}
getFriday(22,2006);
?>