Greetings, Does anyone know of a way to essentially explode a string that has no separator character? I'm trying to take a X character long string and either break it in to X new strings or an array with X entries. Is there any way to do this efficiently besides running a substr function for each place of the string? Thanks, Derek
you could try for example:
preg_match_all("/(.{5})/",$string,$array);
try to print_r($array[1]) - it'll contains strings, each 5 chars long.
$array=preg_split('',$string,PREG_SPLIT_NO_EMPTY);
will break an n-char string to an n-element array.