Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function array_column($array, $value, $key = null) {
- return array_reduce ($array, function ($result, $item) use ($property, $key) {
- if ($key) $result[$item[$key]] = $value;
- else $result[] = $value;
- return $result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment