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

str_split() Function in PHP
Previous Home Next

str_split()

The str_split() function splits a string into an array.

Syntax:
str_split(string,length)

In above syntax, "string& specifies the string to split, "length" specifies the length of each array element default is 1

Example:

<?php
print_r(str_split("Gud"));
echo "<br/>";
print_r(str_split("Morning",4));
?>

Output:

Array ( [0] => G [1] => u [2] => d ) 
Array ( [0] => Morn [1] => ing )

Previous Home Next