php Two-dimensional array traversal assignment
My personal wording in the project:
Traversing a two-dimensional array
foreach ($tmp _array as $key = + $value) {
URL for dynamically generated pictures
$attach _url = $this->qiniu_utils->get_download_url ($tmp _array[$key [' attach_save_name '], ' 7vih5p.com1.z0.glb.clouddn.com ', ' PRIVATE ');
Assignment URL
$tmp _array[$key] [' attach_save_url '] = $attach _url;
}
$result [' feed_img_ids '] = $tmp _array;
---------------------------------------------------------------------------the following is the online reference answer
Q:
$arr = Array (' One ' =>array (' name ' = ' = ' Zhang San ', ' age ' = ' ~ ', ' sex ' = ' male '),
' =>array ' (' name ' = ' John Doe ', ' age ' = ' ', ' sex ' = ' female '),
' Three ' =>array (' name ' = ' Harry ', ' age ' = ' + ', ' sex ' = ' man '),
' Four ' =>array (' name ' = ' Zhao Liu ', ' age ' = ' n ', ' sex ' = ' female ');
foreach ($arr as $key = = $value) {
foreach ($value as $key 2=> $value 2) {
$arr [$ey] [$value] [$key 2][' age ']= 55;
}
}
Print_r ($arr);
How do I assign a new value to age?
A:
foreach ($arr as $key = = $value) {
$arr [$key] [' Age ']=55
}
Look at your needs, it's all right.
Reference 2:
PHP Traversal array assignment why not?
Http://www.oschina.net/question/1434721_149652?sort=default&p=2#answers
**php two-dimensional array time-duration assignment