Skip to content Skip to footer navigation
You are reading the docs for an old version of Statamic. Consider upgrading to Statamic 6.

Contains Any Modifier

Search a string against multiple needles and return true if any are found, otherwise false. Case-insensitive.

summary: "It was the best of times, it was the worst of times."
{{ if summary | contains_any('good', 'better', 'best') }}
@if (Statamic::modify($summary)->containsAny(['good', 'better', 'best'])->fetch()) @endif
true