---
layout: doc
title: general / explode_reversible
---
# explode_reversible

### NAME

    explode_reversible() - split a string while preserving empty fields

### SYNOPSIS

    string array explode_reversible( string str, string separator );

### DESCRIPTION

    Splits str around separator and returns the resulting array of strings.
    Unlike explode() on drivers that discard leading or repeated empty
    fields, explode_reversible() preserves the empty fields required to
    rebuild the original string.

    For any string str and separator sep:

        implode(explode_reversible(str, sep), sep) == str

    If separator is the empty string, str is split into individual
    characters.  If str is the empty string, an empty array is returned.

### EXAMPLE

    explode_reversible("..x.y..z..", ".");

    returns:

        ({ "", "", "x", "y", "", "z", "", "" })

### SEE ALSO

    explode(3), implode(3)
