Just for syntax purposes, you could also shorten your code in a couple of ways:
if ($month==1 || $month==3 || $month==5 || $month==7 || $month==8 || $month==10 || $month==12) echo "31";
else if($month==4 || $month==6 || $month==9 || $month==11) echo "30";
else echo "28";
or
if(in_array($month, array(1, 3, 5, 7, 8, 10, 12))) echo "31";
else if(in_array($month, array(4, 6, 9, 11))) echo "30";
else echo "28";
or
switch($month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
echo "31";
break;
case 4:
case 6:
case 9:
case 11:
echo "30";
break;
case 2:
echo "28";
break;
}
Again, however, for this specific application you should use the date() function instead, since February doesn't always have 28 days.