---
title: "Contains ViewHelper <f:contains>"
manual: "Fluid ViewHelper Reference"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-contains@14.3"
source: "Global/Contains.rst"
rendered: "2026-10-01T16:43:06+00:00"
---

# Contains ViewHelper `<f:contains>` {#typo3fluid-fluid-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 {#typo3fluid-fluid-contains-arguments}

-   **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)
