Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. $wp_time = current_time( 'timestamp', 0 );
  2. $chat_time = get_field('chat_time', 'option');
  3. $chat_time_from = array();
  4. $chat_time_till = array();
  5. foreach($chat_time as $ct) {
  6.     $chat_time_from = strtotime($ct['chat_time_from']);
  7.     $chat_time_till = strtotime($ct['chat_time_till']);
  8.     if ($wp_time >= $chat_time_from && $wp_time <= $chat_time_till) {
  9.         echo "show";
  10.     } else {
  11.         echo "dont";
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement