PHP Programing language

chunk_split() Functions in PHP
Previous Home Next
adplus-dvertising

chunk_split()

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

Syntax:
chunk_split(string,length,end)

"string" specifies the string to split, "length" defines the length of the chunks. Default length of chunk is 76. and "end" defines what to place at the end of each chunk. Default is \r\n

Example:

<?php
$str = "Gud Morning!";
echo chunk_split($str,1,".");
?>

Output:

G.u.d. .M.o.r.n.i.n.g.!.

Previous Home Next