HH\Lib\Str\join
Returns a string formed by joining the elements of the Traversable with the
given $glue
string
namespace HH\Lib\Str;
function join(
Traversable<arraykey> $pieces,
string $glue,
): string;
Previously known as implode
in PHP.
Guide
Parameters
Traversable<arraykey>
$pieces
string $glue
Returns
string
Examples
$strings= vec["a", "b", "c", "d"];
$joined_string_1 = Str\join($strings, ",");
echo "First string: $joined_string_1 \n";
$joined_string_2 = Str\join($strings, "-");
echo "Second string: $joined_string_2";