String chunk_split () for php string functions
Posted In:
php string functions
.
By design
Formula for (PHP 3 >= 3.0.6, PHP 4, PHP 5)
string chunk_split ( string body , int chunklen , string end )
Parameter
string body = Required. Specifies the string to split
int chunklen = Optional. A number that defines the length of the chunks. Default is 76
string end = Optional. A string that defines what to place at the end of each chunk. Default is \r\n
Description
chunk_split() adds the character(s) specified in chunk_ending every chunk_length characters. This function is useful for breaking certain types of data into separate lines of a specified length. It's often used to make base64 encoded data conform to RFC 2045.
Example
In this example we will split the string after each character and add "." after each split
The output of the code :
0 Responses to String chunk_split () for php string functions
Something to say?