I need to split a string into an array of letters. The problem is that in my language (Croatian) there are double character letters aswell (e.g. lj, nj, dž).
So the string such as ljubičicajecvijet
should be split into an array that would look like this:
Array
(
[0] => lj
[1] => u
[2] => b
[3] => i
[4] => č
[5] => i
[6] => c
[7] => a
[8] => j
[9] => e
[10] => c
[11] => v
[12] => i
[13] => j
[14] => e
[15] => t
)
Here is the list of Croatian characters in an array (I included English letters aswell).
$alphabet= array(
'a', 'b', 'c',
'č', 'ć', 'd',
'dž', 'đ', 'e',
'f', 'g', 'h',
'i', 'j', 'k',
'l', 'lj', 'm',
'n', 'nj', 'o',
'p', 'q', 'r',
's', 'š', 't',
'u', 'v', 'w',
'x', 'y', 'z', 'ž'
);