1

If I have a string like:

$location_to_update = '3,2,1';

how can I convert this string into a location I need to update in an associative array i.e.

$my_array['3']['2']['1'] = 'my new value';

? So separate the commas (explode) and then turn that array into a variable that can update that part of an associate array? Thank you!

user1190132
  • 515
  • 4
  • 18

0 Answers0