Last active
February 23, 2019 16:46
-
-
Save lol97/abf3a87031f8277d249c5fdf24e44f45 to your computer and use it in GitHub Desktop.
Ask PHP 7,Array
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 | |
| $data = [ | |
| 0 => [ | |
| 'nama_file' = 'wajah1.png', | |
| 'id' = 'orang1', | |
| 'bit-depth' = 8, | |
| ], | |
| 1 => [ | |
| 'nama_file' = 'wajah2.png', | |
| 'id' = 'orang2', | |
| 'bit-depth' = 16, | |
| ] | |
| ]; | |
| $bit_depth=[8,16]; | |
| //expected output | |
| $data = [ | |
| 'satu' => [ | |
| 'nama_file' = 'wajah1.png', | |
| 'id' = 'orang1', | |
| 'bit-depth' = 8, | |
| ], | |
| 'dua' => [ | |
| 'nama_file' = 'wajah2.png', | |
| 'id' = 'orang2', | |
| 'bit-depth' = 16, | |
| ] | |
| ]; | |
| ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
psudocode
Ini asumsi length kedua arrah nya sama
for (i = 0; i < data.length; i++ ) {
data['bit-depth'] = bit-depth[i]
}