You have a problem with preg split and utf. This is the code:
$original['words'] = preg_split("/[\s]+/", $original['text']);
print_r($original);
This is the answer:
Array
(
[text] => Šios baterijos kaista
[words] => Array
(
[0] =>
[1] => ios
[2] => baterijos
[3] => kaista
This code runs as part of CakePHP. Note that [text] appears correctly before words and is spoiled in schism. By the way, I tried using them:
mb_internal_encoding( 'UTF-8');
mb_regex_encoding( 'UTF-8');
ini_set('default_charset','utf-8');
Nothing helped. Thank.
source
share