← All built-ins / split()

split()

split(string $haystack, string $needle): mixed

Parameters

NameTypeDescription
$separatorstringdelimiter
$sstringstring to split

Return value

Alias of explode().

Example

echo implode("+", split("-", "1-2-3"));
1+2+3

See also

explode()