Skip to content

Instantly share code, notes, and snippets.

@fredrick
Created March 28, 2011 08:38
Show Gist options
  • Save fredrick/890158 to your computer and use it in GitHub Desktop.
Save fredrick/890158 to your computer and use it in GitHub Desktop.
Way to return unique distinct values by a given key?
'key1' => 'somevalue'
'key1' => 'somevalue'
'key2' => 'anotherval'
'key2' => 'andanother'
'key2' => 'andanother'
/*
Way to return unique distinct values by a given key?
For example:
?key="key1" would return ['somevalue']
?key="key2" would return ['anotherval', 'andanother']
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment