Hi,
Does anyone know of a way to explode a string into and array of characters?
explode("", $string); // Returns FALSE
not sure if there is a function that could handle it, but a good ol\' for loop would do the trick..
for (i=0;i<strlen($string);i++) { $chararray[$i] = substr($string,$i,1); }
you don't actually need to, you can refer to a string as an array, so if,
$string = "Hello"; print $string[0]; print $string[4];
would print , 'Ho' (without quotes);
Jamie
But if you do want to use a function, the PHP manual points out how to do it in the entry for the split() function (it refers you to preg_split()).