File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,34 @@ public static function contains(string $string, string $find): bool
93
93
return strpos ($ string , $ find ) !== false ;
94
94
}
95
95
96
+ /**
97
+ * @param string[] $find
98
+ */
99
+ public static function containsAny (string $ string , array $ find ): bool
100
+ {
101
+ foreach ($ find as $ value ) {
102
+ if (strpos ($ string , $ value ) !== false ) {
103
+ return true ;
104
+ }
105
+ }
106
+
107
+ return false ;
108
+ }
109
+
110
+ /**
111
+ * @param string[] $find
112
+ */
113
+ public static function containsAll (string $ string , array $ find ): bool
114
+ {
115
+ foreach ($ find as $ value ) {
116
+ if (strpos ($ string , $ value ) === false ) {
117
+ return false ;
118
+ }
119
+ }
120
+
121
+ return true ;
122
+ }
123
+
96
124
public static function substring (string $ string , int $ start , ?int $ length = null ): string
97
125
{
98
126
return Strings::substring ($ string , $ start , $ length );
You can’t perform that action at this time.
0 commit comments