php explode all characters [duplicate]
问题 This question already has an answer here: PHP: Split string into array, like explode with no delimiter 9 answers I'm looking for the equivalent of what in js would be 'this is a string'.split('') for PHP. If I try $array = explode('', 'testing'); I get an error Warning: explode() [function.explode]: Empty delimiter in Is there another way to do this? 回答1: As indicated by your error, explode requires a delimiter to split the string. Use str_split instead: $arr = str_split('testing'); Output