From the calculation returns -30.
How can I remove the minus, so it just returns 30
$days = (strtotime(date("Y-m-d")) - strtotime($info['expiredate'])) / (60 * 60 * 24)
echo $days
What is the best approach?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So long as you are sure the calculation is always in the right order, you can just use the
abs()function to always display the positive number.