Javatpoint Logo
Javatpoint Logo

PHP chunk_split() Function

PHP chunk_split() function is used to splits a string into smaller parts or chunks. The function does not alter the original string.

Syntax:

Parameter Description Required/Optional
string String to split Required
Length Specify the length of the chunks. Default is 76 Optional
end Specify what to place at the end each chunk. Optional

Example 1

Output:

Hello ...javatp...oint!...

Example 2

Output:

Your string is: Hello
By using 'chunk_split()' function your string is: H.e.l.l.o.

Next TopicPHP String




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA