Say I have a string coming in, "2007-02-28"
, what's the simplest code I could write to turn that into "2007-03-01"
? Right now I'm just using strtotime()
, then adding 24*60*60
, then using date()
, but just wondering if there is a cleaner, simpler, or more clever way of doing it.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
It's cleaner and simpler to add 86400. :)
The high-tech way is to do:
but that's really only remotely worthwhile if you're doing, say, a sequence of transformations on the date, rather than just finding tomorrow.
The simplest way...
OR from specified date...
Hello you can try this below especially if you are french
to translate in french you can use the setlocale() function or the function below :
Another way is to use function mktime(). It is very useful function...
but I think
strtotime()
is better in that situation...