String Functions
All functions below are in the Cline\fp namespace.
Available Functions
Section titled “Available Functions”explode(string $delimiter)
Section titled “explode(string $delimiter)”Explode a piped string using $delimiter.
use function Cline\fp\explode;
$words = pipe("Hello World", explode(' '));// $words is ['Hello', 'World']implode(string $glue)
Section titled “implode(string $glue)”Implode a piped array using $glue.
use function Cline\fp\implode;
$sentence = pipe(['Hello', 'World'], implode(' '));// $sentence is 'Hello World'replace(array|string $find, array|string $replace)
Section titled “replace(array|string $find, array|string $replace)”Does a find/replace in a piped string, using str_replace().
use function Cline\fp\replace;
$result = pipe("Hello World", replace('World', 'PHP'));// $result is 'Hello PHP'