There are two methods for PHP to obtain the current timestamp. It is recommended to use time().
time() gets the current timestamp.
Related recommendations: "php tutorial"
Save it and preview it in the browser to get the current timestamp.
strtotime() gets the current timestamp.
Comparison between time() and strtotime():
The above is the detailed content of There are several ways to get timestamp in php. For more information, please follow other related articles on the PHP Chinese website!