PHP strtotime function with the example

Editorial Staff - - PHP Tutorials


If you want to change the date and time format in PHP programming language, then keep your close attention in this post as I am going to share about the PHP strtotime function with the example.

PHP strtotime function with the example

The strtotime() function is a built-in function in PHP programming language. This function will change the textual DateTime into a Unix timestamp as per your requirement.

Syntax:

Below is the Syntax of strtotime function in PHP code.

Example 1) strtotime() function example

Example 2) strtotime() function example

1525564800
2018-05-06