PHP: Split string into array, like explode with no delimiter
问题 I have a string such as: "0123456789" and need to split EACH character into an array. I for the hell of it tried: explode('', '123545789'); But it gave me the obvious: Warning: No delimiter defined in explode) .. How would I come across this? I can't see any method off hand, especially just a function 回答1: $array = str_split("0123456789bcdfghjkmnpqrstvwxyz"); str_split takes an optional 2nd param, the chunk length (default 1), so you can do things like: $array = str_split("aabbccdd", 2); //