What is the best way to add additional values to inner arrays in a multidimensional array in PHP?

When adding additional values to inner arrays in a multidimensional array in PHP, you can access the specific inner array by using its key and then simply assign the new value to a new key within that inner array. This allows you to easily expand the data structure without altering the existing values.

// Example multidimensional array
$multiArray = [
    ['name' => 'John', 'age' => 25],
    ['name' => 'Jane', 'age' => 30]
];

// Adding additional values to inner arrays
$multiArray[0]['city'] = 'New York';
$multiArray[1]['city'] = 'Los Angeles';

// Output the updated multidimensional array
print_r($multiArray);