3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = '5m Grab a beer!'; $p = str_split($a); var_dump(array_values($p));
based on cQ5uD
Output for 5.6.0 - 7.3.0beta1
array(15) { [0]=> string(1) "5" [1]=> string(1) "m" [2]=> string(1) " " [3]=> string(1) "G" [4]=> string(1) "r" [5]=> string(1) "a" [6]=> string(1) "b" [7]=> string(1) " " [8]=> string(1) "a" [9]=> string(1) " " [10]=> string(1) "b" [11]=> string(1) "e" [12]=> string(1) "e" [13]=> string(1) "r" [14]=> string(1) "!" }