php explode all characters [duplicate] php explode all characters [duplicate] arrays arrays

php explode all characters [duplicate]


As indicated by your error, explode requires a delimiter to split the string. Use str_split instead:

$arr = str_split('testing');

Output

Array(    [0] => t    [1] => e    [2] => s    [3] => t    [4] => i    [5] => n    [6] => g)


Use the str_split function.

$array = str_split( 'testing');


$string = "TEST";echo $string[0];  // This will display T

There is no need to explode it