$mysql_datetime = '2021-03-25 12:30:00'; $unix_timestamp = strtotime($mysql_datetime); echo $unix_timestamp; // output: 1616679000
$mysql_timestamp = '2021-03-25 12:30:00'; $unix_timestamp = mysql2unix($mysql_timestamp); echo $unix_timestamp; // output: 1616679000In this example, we use the `mysql2unix` function directly to convert the MySQL timestamp to Unix timestamp. To use the `mysql2unix` function, you need to include the PHP Date library in your code. This library is built-in and does not require any additional installation.