Skip to tool

PHP chunk_split() Online

Split a string into fixed chunks.

The output updates as you type. The tool processes input in your browser.

Worked example

Chunks have a fixed width and can break across words. Use word wrap when word boundaries need to be kept.

Chunk length
3
Chunk ending
"\\n"
Sample input
manualsplus
Sample output
man\nual\nspl\nus\n

Using this operation in PHP

The interactive result uses JavaScript. PHP strings hold bytes. Use the multibyte string extension when offsets or lengths should follow decoded characters.

PHP reference