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

Ends With Modifier

Returns true if the value ends with a given string. This comparison is case-insensitive.

punchline: That's what she said!
{{ if (punchline | ends_with('she said!')) }}
{{ if (punchline | ends_with('your mom!')) }}
@if (Statamic::modify($punchline)->endsWith('she said!')->fetch())
@endif
@if (Statamic::modify($punchline)->endsWith('your mom!')->fetch())
@endif
true
false