PHP - substr and UTF-8
If you have a problem working with strings in PHP UTF-8 - the problem is probably that substr goes by the number of bits and not by the number of characters. In UTF-8 has more bits each character, so it then hacking away with chain hooks and accents more than it should (today it cost me 2 hours searching in the code before I figured out that the error is not on my receiver). This can solve their own functions.
Functions such as piko_substr
function piko_substr($text, $odkud, $kam) { $temp = iconv("iso8859-2", "utf-8", substr(iconv("utf-8", "iso8859-2", $text),$odkud,$kam)); return($temp); } 






















What about mb_substr ();
Mb_substr alone () sometimes does not work and the top is necessary to add:
mb_internal_encoding ("UTF-8");
mb_http_output ("UTF-8");
ob_start ('mb_output_handler');
Make it the same as those rows with iconv ...