2011-02-01

Problems with UTF-8 in Yii/Php

If you've got problems with UTF-8 in Yii/Php (using strlen or substr)... here is the solution:
mb_internal_encoding("UTF-8"); //set encoding

mb_strlen($utfstring); //use mb_strlen instead strlen
mb_substr($utfstring); //the same thing for substr

Комментариев нет:

Отправить комментарий