R4R Team working to provide free of cost for experienced and freshers

Tutorials | Examples|Interview Questions and Answers|Java Tutorials| C Tutorials | C++ Tutorials | Spring Tutorials| Hibernate Tutorials | JSP Tutorials | Servelets Tutorials| C# Tutorials | PHP Tutorials etc , Basics | Download Software | Data Types | Variables | Constant | Storage & Classes | Operators | Decisions Making | Loops | Functions| Numbers | Arrays | Pointers | String | Datastructure | Expressions | Preprocessor Statement | I/O | Exception Handling | OOPs Tutorial | Classes and object |C++ Inheritance Overloading | Polymorphism | Abstraction | Encapsulation | Interfaces | Multithreading etc

PHP Programing language

chunk_split() Functions in PHP
Previous Home Next

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