What is the correct syntax to access a date or time value from a nested array in PHP?

When accessing a date or time value from a nested array in PHP, you need to use multiple array keys to navigate through the nested structure. You can access the value by chaining array keys together to reach the desired element containing the date or time value.

// Sample nested array containing date and time values
$data = [
    'nested' => [
        'sub_array' => [
            'date' => '2022-01-01',
            'time' => '14:30:00'
        ]
    ]
];

// Accessing the date and time values from the nested array
$date = $data['nested']['sub_array']['date'];
$time = $data['nested']['sub_array']['time'];

echo "Date: $date, Time: $time";