How can the issue of displaying the wrong year when using strtotime be avoided in PHP?

When using strtotime in PHP, the issue of displaying the wrong year can be avoided by providing a complete date format to strtotime. This ensures that strtotime interprets the date correctly and returns the expected result. By specifying the date format explicitly, PHP can accurately parse the input string and avoid any ambiguities.

$dateString = '01/02/22'; // January 2, 2022
$timestamp = strtotime($dateString);
echo date('Y-m-d', $timestamp); // Output: 2022-01-02