File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,11 @@ Methods to Search and Replace
300
300
u('avatar-73647.png')->match('/avatar-(\d+)\.png/');
301
301
// result = ['avatar-73647.png', '73647']
302
302
303
+ // checks if the string contains any of the other given strings
304
+ u('aeiou')->containsAny('a'); // true
305
+ u('aeiou')->containsAny(['ab', 'efg']); // false
306
+ u('aeiou')->containsAny(['eio', 'foo', 'z']); // true
307
+
303
308
// finds the position of the first occurrence of the given string
304
309
// (the second argument is the position where the search starts and negative
305
310
// values have the same meaning as in PHP functions)
@@ -327,6 +332,10 @@ Methods to Search and Replace
327
332
return '['.$match[0].']';
328
333
}); // result = '[1][2][3]'
329
334
335
+ .. versionadded :: 5.1
336
+
337
+ The ``containsAny() `` method was introduced in Symfony 5.1.
338
+
330
339
Methods to Join, Split, Truncate and Reverse
331
340
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332
341
You can’t perform that action at this time.
0 commit comments