How to Explode Every Character into Array Using PHP Example?

PHP

Nicesnippets

144

22-11-2021


How to Explode Every Character into Array Using PHP Example?

Hi All,

In this article, we will implement a php explode all characters. you will learn explode all characters php. you can see how to explode all character in php using str_split().

This post will give you example of php explode every character into array.

So, let's see simple example here:

Example :


<?php

$name = "Nicesnippets Example";

$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

[12] =>

[13] => E

[14] => x

[15] => a

[16] => m

[17] => p

[18] => l

[19] => e

)

I hope it help you...


Recommended Posts