Reputation: 347
I want to set PHP COOKIE which should be stored for only one day. Setting a cookie for one day is easier.
If the user visits the site at 6PM, then the cookie should be set for another six hours only.
$tomorrow = mktime(0,0,0,$month,$date+1,$year);
where month, date and year are from the PHP date function. Will the above code work as i expected?
Or is there any better way to do this?
Upvotes: 4
Views: 144
Reputation: 20220
Try using the strtotime()
function with the tomorrow
keyword:
$tomorrow = strtotime('tomorrow');
Upvotes: 6