Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーがパスワードを忘れたボタンをクリックしてから 3 時間後に有効期限が切れるように URL を設定したいのですが、現在の時刻とタイムスタンプを比較して 3 時間を超えているかどうかを確認する考えがありません。
元。データベースで
request_time (タイムスタンプ) = 2012-10-22 02:00:00
expire_time (タイムスタンプ) = 2012-10-22 05:00:00
<?php if( strtotime('2012-10-22 02:00:00') + 60*60*3 < time() ) { // expired }
これは私がすることです:
strtotime('now')