PHP chunk_split() Function

PHP chunk_split() Function

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

Syntax

Parameter

string(required)- It specifies the string to split.

length(optional)- This parameter represents a number that defines the length of the chunks. Its default value is 76.

end(optional)- This parameter signifies a string that defines what to place at the end of each chunk and its default value is \r\n.

Return

This function returns the chunked string.

Example 1

Output

Example 2

Output

Example 3

Output