---
title: "Split ViewHelper <f:split>"
manual: "Fluid Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/fluid:typo3fluid-fluid-split"
source: "ViewHelpers/Fluid/Split.rst"
rendered: "2026-10-08T14:12:40+00:00"
---

# Split ViewHelper `<f:split>` {#typo3fluid-fluid-split}

> [!NOTE]
> This reference is part of the documentation of Fluid Standalone.
> If you are working with Fluid in TYPO3 CMS, please refer to
> [TYPO3's ViewHelper reference](https://docs.typo3.org/other/typo3/view-helper-reference/14.3/en-us/Global/Split.html) instead.

The SplitViewHelper splits a string by the specified separator, which
results in an array. The number of values in the resulting array can
be limited with the limit parameter, which results in an array where
the last item contains the remaining unsplit string.

This ViewHelper mimicks PHP's `explode()` function.

The following examples store the result in a variable because an array cannot
be outputted directly in a template.

## Examples {#examples}

### Split with a separator {#split-with-a-separator}

```php
<f:variable name="result"><f:split value="1,5,8" separator="," /></f:variable>

```

```text
{0: '1', 1: '5', 2: '8'}
```

### Split using tag content as value {#split-using-tag-content-as-value}

```php
<f:variable name="result"><f:split separator="-">1-5-8</f:split></f:variable>

```

```text
{0: '1', 1: '5', 2: '8'}
```

### Split with a limit {#split-with-a-limit}

```php
<f:variable name="result"><f:split value="1,5,8" separator="," limit="2" /></f:variable>

```

```text
{0: '1', 1: '5,8'}
```

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

**Arguments**

The following arguments are available for the split ViewHelper:

-   **limit**

    -   *Type:* int
    -   *Default:* 9223372036854775807

    If limit is positive, a maximum of $limit items will be returned. If limit is negative, all items except for the last $limit items will be returned. 0 will be treated as 1.

-   **separator**

    -   *Type:* string
    -   *Required:* true

    Separator string to explode with

-   **value**

    -   *Type:* string

    The string to explode
