PHP: How to convert a string to an array of it's characters in PHP?
If you want to get an array of (single) letters from a string, it is easy in PHP! Here is how to do it:
str_split() to get a text string's characters as an array
- $input = "asdfgh";
- $array = str_split($input); // ['a','s','d','f','g','h']