How can PHP handle whitespace characters when concatenating date and time strings for MySQL storage?

When concatenating date and time strings for MySQL storage in PHP, it's important to ensure that there are no whitespace characters in the resulting string. This can be achieved by using the `trim()` function to remove any leading or trailing whitespace before storing the string in the database.

$date = "2022-01-01";
$time = "12:00:00";
$datetime = trim($date . " " . $time);
// Store $datetime in MySQL database