Created
October 9, 2014 01:54
-
-
Save hanafiah/a8628b0be5e9e2dcfb61 to your computer and use it in GitHub Desktop.
contoh 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = [ | |
'a' => [ | |
0=>[ | |
'file_name'=>'abc', | |
'file_type'=>'image/jpeg', | |
], | |
1=>[ | |
'file_name'=>'def', | |
'file_type'=>'image/jpeg', | |
] | |
] | |
]; | |
print_r($arr); | |
$arr=add_product_num($arr,2); | |
print_r($arr); | |
function add_product_num($array,$product_num){ | |
foreach($array['a'] as $key=>$rows){ | |
$rows['product_num'] = $product_num; | |
$array['a'][$key]=$rows; | |
} | |
return $array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment