Could anybody explain, why this code
$string='6аd_ТЕХТ GOOD_TEXT';
$words = preg_split('/\s+/', $string, NULL, PREG_SPLIT_NO_EMPTY);
var_dump($words);
displays
array(2) { [0]=> string(8) "6àd_ÒÅÕÒ" [1]=> string(9) "GOOD_TEXT" }
instead of
array(2) { [0]=> string(8) "6аd_ТЕХТ" [1]=> string(9) "GOOD_TEXT" }
I've read about this issue, but adding /u :
preg_split('/\s+/', $string, NULL, PREG_SPLIT_NO_EMPTY);// '/\s+/'
to become
preg_split('/\s+/u', $string, NULL, PREG_SPLIT_NO_EMPTY);// '/\s+/u'
doesn't help. How to fix this issue?
Thank you.