You are here: Re: Simple PHP that isn't working « All PHP « IT news, forums, messages
Re: Simple PHP that isn't working

Posted by Kim Andrι Akerψ on 10/13/15 11:27

Marc wrote:

> plato wrote:
> > Try this:
> >
> > --- PHP ---
> > if (date ("G") < 12) {
> > $timeOfDay = "Morning";
> > } elseif (date ("G") < 18) {
> > $timeOfDay = "Afternoon";
> > } else {
> > $timeOfDay = "Evening";
>
> Thanks plato, I'll keep that in mind as another possible solution. :)

And if it still doesn't work, try it this way:

<?php
if (intval(date("G")) < 12) { $timeOfDay = "Morning"; }
elseif (intval(date("G")) < 18) { $timeOfDay = "Afternoon"; }
else { $timeOfDay = "Evening"; }
?>

--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация