• PHP Video Tutorials

PHP - Function chunk split



Syntax

string chunk_split ( string $body [, int $chunklen = 76 [, string $end = "\r\n" ]] )

Definition and Usage

It is used to split a string into chunks

Return Values

It returns the chunked string

Parameters

Sr.No Parameters & Description
1

body

In body, string to be chunked

2

chunklen

It contains the information about chunk length

3

end

It contains the information about line ending string

Example

Try out the following example

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

This will produce following result −

t.u.t.o.r.i.a.l.s.p.o.i.n.t.
php_function_reference.htm
Advertisements