Home » PHP chunk_split() function

PHP chunk_split() function

by Online Tutorials Library

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 ...Tutor...aspire!...  

Example 2

Output:

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

Next TopicPHP String

You may also like