What are some common methods to convert a date to a timestamp in PHP?

When working with dates in PHP, it is common to need to convert a date to a timestamp for various operations such as comparisons or calculations. One common method to convert a date to a timestamp is by using the strtotime() function in PHP. This function takes a date string as input and returns a Unix timestamp representing that date.

$date = "2022-01-15";
$timestamp = strtotime($date);
echo $timestamp;