php - Display content based on date and time -



php - Display content based on date and time -

i'm needing display content during day , time.

i have script i'm using @ moment displays content depending on day of week need extend display content between 2 sets of hours content on mon between 12am , 5pm between 5pm , 11.59pm , same each day of week.

<?php if( date( 'w' ) == 0 ) { ?> <div>write need show here on sunday</div> <? } if( date( 'w' ) == 1 ) { ?> <div>write need show here on monday</div> <? } ?> <? if( date( 'w' ) == 2 ) { ?> <div>write need show here on tuesday</div> <? } ?> <? if( date( 'w' ) == 3 ) { ?> <div>write need show here on wednesday</div> <? } ?> <? if( date( 'w' ) == 4 ) { ?> <div>write need show here on thursday</div> <? } ?> <? if( date( 'w' ) == 5 ) { ?> <div>write need show here on friday</div> <? } ?> <? if( date( 'w' ) == 6 ) { ?> <div>write need show here on saturday</div> <? } ?>

drop , pm , think in 24 hours.

if (date('w') == 1) { if (date('h') >= 0 && date('h') < 17) { // thing want on mon 0:00 (12 am) 17:00 (5pm) } }

php date time

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

ruby on rails - Devise Logout Error in RoR -