PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have one page that writes the time to a text file when called. I have a second page that reads this time and compares it to the current time. I need to subtract the two and have tried using strotime, but it does not work correctly. What am I doing wrong?
What does $theData look like? If it is a unix timestamp then just subtract it from time(), don't use date(). Also, you use $exp_date and then later compare $expiration_date.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Thanks, that's helpful.
I'll correct $expiration_date to $exp_date and change date to time.
I don't think the date that is already saved in the text file is a unix stamp, just a date, which is probably my main problem.
I agree with AbraCadaver. If you subtract using unix time stamps it will make thins much more simplistic. You could then format the results however you want.