webCOMAND

#EXPLODE

Return an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter.

Prototype

#EXPLODE($delimiter, $string)

Parameters

  • delimiter - The boundary string.
  • string - The input string.

Return

Returns an array of strings created by splitting the string parameter on boundaries formed by the delimiter.  If delimiter is an empty string (""), FALSE is returned.

Example

#* Produce an HTML list of Wordstab multiple lines of text *#
#NEW($Text)This is some text.#ENDNEW
#ASSIGN($Words,#EXPLODE(' ', $Text))
<ul>
#FOREACH($Words AS $Word)
    <li>$Word</li>
#ENDFOREACH
</ul>

Related

#IMPLODE()