jammesz Posted January 15, 2008 Share Posted January 15, 2008 I made a calendar script that relies on the date("N") to tell the numeric representation of the day of the week. But the problem is that it doesn't work on php4 as it was added in php5. Is there a way around this??? Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/ Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 i think your after $weekday = date("d"); Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439705 Share on other sites More sharing options...
jammesz Posted January 15, 2008 Author Share Posted January 15, 2008 no as that gives the day of the month, i want the day of the week Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439708 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 so you want mon, tue, wed, thur, fri, sat, sun to be represented as 1,2,3,4,5,6,7 Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439720 Share on other sites More sharing options...
jammesz Posted January 15, 2008 Author Share Posted January 15, 2008 yea, exactly wat date("N") does Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439722 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 not sure on this one but you could try this $weekday = date("D"); switch ($weekday) { case "Mon": $weekday=1; break; case "Tue": $weekday=2; break; case "Wed": $weekday=3; break; } Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439725 Share on other sites More sharing options...
jammesz Posted January 15, 2008 Author Share Posted January 15, 2008 oh... I overlooked that on the php date manual . Thanks for the help Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439727 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 dont forget to click topic solved Link to comment https://forums.phpfreaks.com/topic/86110-solved-php4-version-of-daten-help/#findComment-439729 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.