Syntax :
string chunk_split(string, chunklength, end) ;
chunk_split() function will return smaller chunks(pieces) of a string in chunklength parameter.
string – String to be chunked.
chunklength – This is Optional parameter, String will be chunked in chunklength size.Chunk Default size is 76.
end – This is Optional parameter. End will defines what to be placed at the end of each chunk. Default is \r\n
This will return the chunks of a string after placing “end” parameter values at the end of each chunk.
$strExample = chunk_split("Hi All",1,"..");
echo($strExample);
In above example ,We have a string “Hi All”. So, when we apply chunk_split() function. This will add “..” two dots after every chunks of string of length 1(one).
Now Output will become –
H..i.. ..A..l..l..
<?php
$strExample = chunk_split("Hi from tutorialmines.net","5","!");
echo($strExample);
?>
In above example ,We have a string “Hi from tutorialmines.net!”. So, when we apply chunk_split() function. This will add “!” (exclamation mark) after every chunks of string of length 5.
Output will be like below:
Hi fr!om tu!toria!lmine!s.net!
When it comes to children, there’s one universal truth: the right toy can spark imagination, build skills, and make memories…
In today’s digital age, where screens and gadgets dominate our children’s lives, there’s something heartwarming about a well-loved plush toy…
In a world dominated by screens and fast-paced routines, it’s easy to forget the simple magic of a toy in…
In the heart of Delhi’s vibrant streets lies a world where imagination meets innovation — the magical universe of toys.…
When was the last time a toy truly amazed you—not just as a product, but as a thoughtful tool for…
In the digital age, the way we experience childhood has changed, but the essence remains the same—imagination, exploration, and joy.…