Most efficient way to delimit key
Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP?
Note: I am rewriting an existing system that is painfully slow.
$string = '0123456789012345'; $sets = str_split($string, 4); print_r($sets);
Array (  => 0123  => 4567  => 8901  => 2345 )
Then of course to insert hyphens between the sets you just implode() them together:
echo implode('-', $sets); // echoes '0123-4567-8901-2345'