Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to return TRUE with time()?

How to return TRUE when an account was created more than 30 days ago?

I have the following date:

$udata['joined']; – record date in time():

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried like this

`If($udata['joined'] = strtotime ("+30 days", time())){

return true;
}`

Any idea why it’s not working correctly?

Return empty.

>Solution :

I guess you want

If timestamp is more than (or exactly) 30 days ago

if ($udata['joined'] <= strtotime("-30 days", time()) {
    return TRUE;
}

(you need to substract 30 days from now and remove all syntax errors)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading