Guest User

Untitled

a guest
Mar 21st, 2013
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2. function array_column($array, $value, $key = null) {
  3.     return array_reduce ($array, function ($result, $item) use ($property, $key) {
  4.       if ($key) $result[$item[$key]] = $value;
  5.       else $result[] = $value;
  6.       return $result;
  7.     }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment