I have some serious problem dealing with files in php with utf-8 encoding. I need to read a file char by char or possibly line by line, with fixed small chunks. I tried to use fgetc and fgets but characters encoded in utf8 are split in a few "chars" instead of only one. I'm trying to find a solution, it could be even a small "string" containing only the character in Unicode but it must be read from file properly.
Pseudo code I would like to use:
while ( ($c == read_utf8_char($file)) != false ) {
if ($c == 'ó') do_something();
}
I would appreciate your help.