Home > Article > Backend Development > Introduction to the usage of chunk_split() function in php
This article introduces the usage of the chunk_split() function in PHP. Friends in need can refer to it.
Definition and usage chunk_split function splits a string into a series of smaller parts. Grammar chunk_split(string,length,end) Parameter Description string required. Specifies the string to be split. length is optional. A number defining the length of the string block. end is optional. A string value that defines what is placed after each string block. Tips and Notes Note: This function does not change the original string. Example 1, separate each character and add ".": Output: H.e.l.l.o. .w.o.r.l.d.!. Example 2, split the string once after six characters and add "...": Output: Hello...world!... |