---
date: 2020-11-13
id: 43cb053d-03b0-4845-a804-5e34da5d8db5
title: str~endswith~()
---

# Description

Check if string ends with other string. Opposite of
[str~startswith~()](20201113115424-str_starts_with). See RFC[^1] for
more details.

# Syntax

``` php
str_ends_with('haystack', 'stack') // true
```

# Footnotes

[^1]: <https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions>