I have an array within an array like:
$some_large_array = array(
'person' => array('name' => 'stefanie', 'hobby' => 'rock climbing',),
'dog' => array('name' => 'orbit', 'hobby' => 'chewing curtains'));
How can I change the value of of 'hobby' of 'dog' and return it as 'napping'?
You can access array keys like this, in your example:
$some_large_array['dog']['hobby'] = 'napping';
(answering to remove from "unanswered" queue)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.