Edson Felix Posted August 24, 2011 Report Share Posted August 24, 2011 O que pode está errado?<? if date >= 00:00:00 and date < 12:00:00 {echo "bom dia";}if date >= 12:00:00 and date < 18:00:00 {echo "bom tarde";}if date >= 18:00:00 and date < 23:59:59 {echo "bom noite";}?> Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted August 24, 2011 Report Share Posted August 24, 2011 $date = date('H:i:s'); if ($date >= 00:00:00 and $date < 12:00:00){ echo "bom dia"; } Quote Link to comment Share on other sites More sharing options...
0 Edson Felix Posted August 24, 2011 Author Report Share Posted August 24, 2011 este exemplo não funciona, no asp temos que colocar "#" nas datas ex: #00:00:00# - será que o php tb num tem algo pra colocar?$date = date('H:i:s'); if ($date >= 00:00:00 and $date < 12:00:00){ echo "bom dia"; } Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted August 24, 2011 Report Share Posted August 24, 2011 if ($date >= '00:00:00' and $date < '12:00:00'){ Quote Link to comment Share on other sites More sharing options...
0 Edson Felix Posted August 24, 2011 Author Report Share Posted August 24, 2011 Muito bom, veja abaixo o código que funcionou através de sua ajuda....<? $date = date('H:i:s');if ($date >= '00:00:00' and $date < '12:00:00'){echo "bom dia";}if ($date >= '12:00:00' and $date < '18:00:00'){echo "boa tarde";}if ($date >= '18:00:00' and $date < '23:59:59'){echo "boa noite";}?> Quote Link to comment Share on other sites More sharing options...
Question
Edson Felix
O que pode está errado?
<?
if date >= 00:00:00 and date < 12:00:00
{
echo "bom dia";
}
if date >= 12:00:00 and date < 18:00:00
{
echo "bom tarde";
}
if date >= 18:00:00 and date < 23:59:59
{
echo "bom noite";
}
?>
Link to comment
Share on other sites
4 answers to this question
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.