Splitting a String by Length in PHP


Split a string into chunks of a specified length with str_split().

Source Code

$string = "HelloWorld";
$chunks = str_split($string, 5);
print_r($chunks);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments