adamhhh Posted March 14, 2007 Share Posted March 14, 2007 if if ($start_year % 4 != 0 etc... so im trying to look to see if the start year isnt divided by 4 (it works for when it is). But this statement doesnt work and i cant figure out why?? Quote Link to comment Share on other sites More sharing options...
mbtaylor Posted March 14, 2007 Share Posted March 14, 2007 if ($start_year % 4 == 0) { # the year is divisible by 4 }else{ # the year is not divisible by 4 } != 0 should work fine too (the opposite obviously). Quote Link to comment Share on other sites More sharing options...
adamhhh Posted March 14, 2007 Author Share Posted March 14, 2007 it should but it doesnt ignore the double if by the way. Quote Link to comment Share on other sites More sharing options...
mbtaylor Posted March 14, 2007 Share Posted March 14, 2007 Odd, only thing I can think is if its looking for false? 1=true, 0=false etc. Maybe the triple equal would sort that !== that does type check too I believe. Quote Link to comment Share on other sites More sharing options...
adamhhh Posted March 14, 2007 Author Share Posted March 14, 2007 nope tried that too ??? Quote Link to comment Share on other sites More sharing options...
mbtaylor Posted March 14, 2007 Share Posted March 14, 2007 bugger knows then lol maybe someone else will enlighten us! Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 14, 2007 Share Posted March 14, 2007 This code <?php $start_year = date('Y')+1; if ($start_year % 4 == 0) { echo "ok"; }else{ echo "not ok"; } ?> works fine for me. Please show us your value of "$start_year" and why you're saying it doesn't work. Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.