---
title: "Contains ViewHelper <f:contains>"
manual: "Fluid ViewHelper Reference"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-contains@13.4"
source: "Global/Contains.rst"
modified: "2026-09-17T09:07:45+00:00"
---

# Contains ViewHelper `<f:contains>`

The ContainsViewHelper checks if a provided string or array contains
the specified value. Depending on the input, this mimicks PHP's
`in_array()` or `str_contains()`.

Go to the source code of this ViewHelper: [ContainsViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/ContainsViewHelper.php).

## Arguments of the `<f:contains>` ViewHelper

-   **else**

    -   *Type:* mixed

    Value to be returned if the condition if not met.

-   **subject**

    -   *Type:* mixed
    -   *Required:* true

    The string or array that might contain the value (haystack)

-   **then**

    -   *Type:* mixed

    Value to be returned if the condition if met.

-   **value**

    -   *Type:* mixed
    -   *Required:* true

    The value to check for (needle)
