Php str_split Function Example
Hi Guys,
In this example,I will learn you how to string every character to convert into array in php.you cab easy and simply string every character to convert into array in php.
So, let's see bellow very simple example here:
Example:
<?php
$name = "Nicesnippets";
$arr = str_split($name);
print_r($arr);
?>
Output:
Array
(
[0] => N
[1] => i
[2] => c
[3] => e
[4] => s
[5] => n
[6] => i
[7] => p
[8] => p
[9] => e
[10] => t
[11] => s
)
It will help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example