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

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: