| @@ 133-145 (lines=13) @@ | ||
| 130 | * @param array $array |
|
| 131 | * @return array |
|
| 132 | */ |
|
| 133 | public function without($array) |
|
| 134 | { |
|
| 135 | $values = func_get_args(); |
|
| 136 | unset($values[0]); |
|
| 137 | ||
| 138 | if ($values) { |
|
| 139 | foreach ($values as $value) { |
|
| 140 | unset($array[array_search($value, $array)]); |
|
| 141 | } |
|
| 142 | } |
|
| 143 | ||
| 144 | return $array; |
|
| 145 | } |
|
| 146 | ||
| 147 | /** |
|
| 148 | * Produces a new version of the array that does not contain any of the specified keys |
|
| @@ 153-165 (lines=13) @@ | ||
| 150 | * @param array $array |
|
| 151 | * @return array |
|
| 152 | */ |
|
| 153 | public function withoutKeys($array) |
|
| 154 | { |
|
| 155 | $values = func_get_args(); |
|
| 156 | unset($values[0]); |
|
| 157 | ||
| 158 | if ($values) { |
|
| 159 | foreach ($values as $value) { |
|
| 160 | unset($array[$value]); |
|
| 161 | } |
|
| 162 | } |
|
| 163 | ||
| 164 | return $array; |
|
| 165 | } |
|
| 166 | ||
| 167 | /** |
|
| 168 | * Fetch the same property for all the elements. |
|