Created
May 18, 2013 20:52
-
-
Save coolhome/5605756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get a subset of the items from the input data. | |
* | |
* @param array $keys | |
* @return array | |
*/ | |
public function only($keys) | |
{ | |
$keys = is_array($keys) ? $keys : func_get_args(); | |
$input = $this->input(); | |
$results = array_only($input, $keys); | |
return array_merge(array_fill_keys($keys, null), $results); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment