Easy Tutorial
❮ Func Error Trigger Error Func Date Date Format ❯

PHP chunk_split() Function

PHP String Reference Manual

Example

Split the string after each character and add a "." after each split:


Definition and Usage

The chunk_split() function splits a string into a series of smaller parts.

Note: This function does not change the original string.


Syntax

Parameter Description
string Required. Specifies the string to be split.
length Optional. A number that defines the length of the string chunks. Default is 76.
end Optional. A string that defines what to place after each chunk. Default is \r\n.

Technical Details

Return Value: Returns the split string.
PHP Version: 4+
--- ---

More Examples

Example 1

Split the string after every six characters and add "..." after each split:


❮ Func Error Trigger Error Func Date Date Format ❯