@@ 54-64 (lines=11) @@ | ||
51 | * |
|
52 | * @return bool Whether or not $str contains $needle. |
|
53 | */ |
|
54 | public function containsAll($needles, $caseSensitive = true) |
|
55 | { |
|
56 | if (empty($needles)) return false; |
|
57 | ||
58 | foreach ($needles as $needle) |
|
59 | { |
|
60 | if (!$this->contains($needle, $caseSensitive)) return false; |
|
61 | } |
|
62 | ||
63 | return true; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * Returns true if the string contains any $needles, false otherwise. |
|
@@ 78-88 (lines=11) @@ | ||
75 | * |
|
76 | * @return bool Whether or not $str contains $needle. |
|
77 | */ |
|
78 | public function containsAny($needles, $caseSensitive = true) |
|
79 | { |
|
80 | if (empty($needles)) return false; |
|
81 | ||
82 | foreach ($needles as $needle) |
|
83 | { |
|
84 | if ($this->contains($needle, $caseSensitive)) return true; |
|
85 | } |
|
86 | ||
87 | return false; |
|
88 | } |
|
89 | } |
|
90 |