-
How to Store and Update Multidimensional Array in PHP
about 5 years ago
-
almost 5 years ago
hi,
you can set or change as follows:-
1. mainArray[ key or keyName ] = value;
2. mainArray[ key or keyName ][next dimension key or keyName] = value;
3. can use php foreach loop to modify or access child element in array
4. can use php inbuilt array functions like array walk or array walk recursive.
foreach example:-foreach($address as &$add){ if($add['address'][0] === 'address_main'){ $add['1'] = 'new_address; } }
-
1 Answer(s)