2009-11-25から1日間の記事一覧

PHPで期間指定のタイマー

PHP

<div class="section"> ある期間中のみ動作する処理をタイマー設定したいときに便利な関数をつくっておくとなにかと重宝する。 public function in_time_range($from, $to) { $now = time(); $from = strtotime($from); $to = strtotime($to); if ($from <= $now && $now <= $to) </div>…