Last active
April 7, 2017 08:28
-
-
Save muhtarudinsiregar/13102fb9b6f67e9b24b690a776f947ff to your computer and use it in GitHub Desktop.
Case Study11.php
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
| return values from multidimensional array | |
| $users = [ | |
| [ | |
| 'id' => 1, | |
| 'name' => 'Adimas Lutfi Wicaksono', | |
| ], | |
| [ | |
| 'id' => 2, | |
| 'name' => 'Salman Alfarisi', | |
| ], | |
| [ | |
| 'id' => 3, | |
| 'name' => 'Muhammad Sholeh', | |
| ], | |
| [ | |
| 'id' => 4, | |
| 'name' => 'Yadi Cahyadi', | |
| ], | |
| [ | |
| 'id' => 5, | |
| 'name' => 'Maya Maulani', | |
| ], | |
| ]; | |
| $names = []; | |
| foreach ($users as $key => $value) { | |
| $names[$key] = $value['name']; | |
| } | |
| print_r($names); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment