Utils/ArrayUtils.php
/**
     * Pick works very much like pop() or shift() but gets data from any key of the
     * array. It also works with associative keys
     *
     * @param array $array
     * @param string $wantedKey
     * @return array
     */
Pick works very much like pop() or shift() but gets data from any key of the
array. It also works with associative keys


Pick works very much like pop () or shift () but gets data from any key of the array . It also works with associative keys
public static function pick(array &$array, $wantedKey)
    {
        $returnVal = array();
        foreach ($array as $key => $value) {
            if ($key === $wantedKey) {
                $returnVal = $value;
            }
        }
        unset($array[$wantedKey]);
        return $returnVal;
    }
public static function pick ( array & $ array , $ wantedKey ) { $ returnVal = array ( ) ; foreach ( $ array as $ key => $ value ) { if ( $ key === $ wantedKey ) { $ returnVal = $ value ; } } unset ( $ array [ $ wantedKey ] ) ; return $ returnVal ; }
Pick works very much like pop() or shift() but gets data from any key of the
 array.
Pick works very much like pop () or shift () but gets data from any key of the array .