How can one properly structure a multidimensional array to avoid conflicts when adding new values in PHP?

When adding new values to a multidimensional array in PHP, it's important to properly structure the array to avoid conflicts. One way to do this is by using unique keys for each sub-array to prevent overwriting existing values. This can be achieved by using associative arrays with distinct keys for each sub-array.

// Properly structured multidimensional array to avoid conflicts
$multiArray = array(
    'subArray1' => array(
        'key1' => 'value1',
        'key2' => 'value2'
    ),
    'subArray2' => array(
        'key3' => 'value3',
        'key4' => 'value4'
    )
);

// Adding a new value to subArray1
$multiArray['subArray1']['key5'] = 'value5';