May i ask you how can i calculate the period by deduct two time parameter like below
$time_1 = $rows['code_send_time'];
$period = time() - $time_1;
after I echo the $period how can I exchange to minute and know how many minutes has passed?
The result after I deduct is “151341193030” and I want the result will be “30” (mins) or “1800” (seconds)
Thanks for your help!
You can use the
DateTimeobject for this. If you check out the docs there is this method:DateTime::diff