mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-18 05:58:20 +01:00
Add Str::chunk()
This commit is contained in:
parent
64d804ca60
commit
55d06098a2
@ -178,4 +178,13 @@ class Str
|
|||||||
$string
|
$string
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Split a string in chunks of given length with a delimiter
|
||||||
|
*/
|
||||||
|
public static function chunk(string $string, string $length, string $delimiter): string
|
||||||
|
{
|
||||||
|
return implode($delimiter, str_split($string, $length));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user