@@ 218-231 (lines=14) @@ | ||
215 | * @param bool $caseSensitive Whether or not to enforce case-sensitivity |
|
216 | * @return bool Whether or not $str contains $needle |
|
217 | */ |
|
218 | public function containsAll($needles, $caseSensitive = true) |
|
219 | { |
|
220 | if (empty($needles)) { |
|
221 | return false; |
|
222 | } |
|
223 | ||
224 | foreach ($needles as $needle) { |
|
225 | if (!$this->contains($needle, $caseSensitive)) { |
|
226 | return false; |
|
227 | } |
|
228 | } |
|
229 | ||
230 | return true; |
|
231 | } |
|
232 | ||
233 | /** |
|
234 | * Returns true if the string contains any $needles, false otherwise. By |
|
@@ 242-255 (lines=14) @@ | ||
239 | * @param bool $caseSensitive Whether or not to enforce case-sensitivity |
|
240 | * @return bool Whether or not $str contains $needle |
|
241 | */ |
|
242 | public function containsAny($needles, $caseSensitive = true) |
|
243 | { |
|
244 | if (empty($needles)) { |
|
245 | return false; |
|
246 | } |
|
247 | ||
248 | foreach ($needles as $needle) { |
|
249 | if ($this->contains($needle, $caseSensitive)) { |
|
250 | return true; |
|
251 | } |
|
252 | } |
|
253 | ||
254 | return false; |
|
255 | } |
|
256 | ||
257 | /** |
|
258 | * Returns the length of the string, implementing the countable interface. |