Is this code ok.? If any better way please suggest me. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is this code ok.? If any better way please suggest me.

simple php code for leap year testing https://code.sololearn.com/wBOqNXnYNTwn/?ref=app

25th Feb 2020, 6:32 PM
sibu dhital
sibu dhital - avatar
3 Answers
+ 1
$text = ($year%4===0 && $year%100!==0) || ($year%400 === 0) ? "is leap year" : "is not"; echo $text;
25th Feb 2020, 7:29 PM
Max_N
Max_N - avatar
+ 1
Your welcome. Thats why we're here :)
25th Feb 2020, 8:09 PM
Max_N
Max_N - avatar
0
Thanks Max_N it is really helpful
25th Feb 2020, 8:08 PM
sibu dhital
sibu dhital - avatar