@@ 323-337 (lines=15) @@ | ||
320 | * |
|
321 | * @return bool Whether or not $str contains $needle |
|
322 | */ |
|
323 | public function containsAll($needles, $caseSensitive = true) |
|
324 | { |
|
325 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
326 | if (empty($needles)) { |
|
327 | return false; |
|
328 | } |
|
329 | ||
330 | foreach ($needles as $needle) { |
|
331 | if (!$this->contains($needle, $caseSensitive)) { |
|
332 | return false; |
|
333 | } |
|
334 | } |
|
335 | ||
336 | return true; |
|
337 | } |
|
338 | ||
339 | /** |
|
340 | * Returns true if the string contains $needle, false otherwise. By default |
|
@@ 370-384 (lines=15) @@ | ||
367 | * |
|
368 | * @return bool Whether or not $str contains $needle |
|
369 | */ |
|
370 | public function containsAny($needles, $caseSensitive = true) |
|
371 | { |
|
372 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
373 | if (empty($needles)) { |
|
374 | return false; |
|
375 | } |
|
376 | ||
377 | foreach ($needles as $needle) { |
|
378 | if ($this->contains($needle, $caseSensitive)) { |
|
379 | return true; |
|
380 | } |
|
381 | } |
|
382 | ||
383 | return false; |
|
384 | } |
|
385 | ||
386 | /** |
|
387 | * Returns the length of the string, implementing the countable interface. |