How can the timezone ID be retrieved without underscores in PHP?

When retrieving the timezone ID in PHP, it often includes underscores between words (e.g., "America/New_York"). If you want to retrieve the timezone ID without underscores, you can use the str_replace() function to replace underscores with spaces.

$timezone = 'America/New_York';
$timezoneWithoutUnderscores = str_replace('_', ' ', $timezone);

echo $timezoneWithoutUnderscores; // Output: America New York