PhP fread and stripos

56 Views Asked by At

I´m getting data with

$newtext = fread($rcon, 102400);

But this script is not working. I tried it with different things burning thing the text I get from my rcon function is not a normal text... Does it make sense ?

$offset = stripos($newtext, 'ÿ');

But if i print it i could see the y

EYî ÿ5aa68

Why is it not working? Its kind of wired.. Because .. It is there..^^ I'm sorry if there is an obvious mistake. I'm pretty new to these things.

Thanks for your help and time :)

1

There are 1 best solutions below

2
On

Take a look to mb_stripos function.
It designed to work with multibyte strings in php.

arth@arth:~$ php -r 'echo stripos("EYî ÿ5aa68", "ÿ")."\n";'                                                                                                                    
5
arth@arth:~$ php -r 'echo mb_stripos("EYî ÿ5aa68", "ÿ")."\n";'
5