Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function flatten2d($multi_dimensional_array) {
- $flattened = [];
- $flatten = function($value, $index) {
- global $flattened;
- array_push($flattened, $value);
- };
- array_walk_recursive($multi_dimensional_array, $flatten);
- return $flattened;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement