I take a yml-file using file_get_contents() , I get the names of the goods from it and compare it with the data in the database. There are no coincidences.

Okay, I get the strings themselves, their length is strlen() and the mb_detect_encoding() encoding. The strings of the Vitek VT-1810 Vacuum Cleaner are the same, the encodings are also (UTF-8, it is also set in the output file, mysql, and in general wherever possible), but the length is different, 85 and 28, respectively.

$name is the name from the resulting file, $wtf is the name from the database, trim used on both lines.

  • strcmp('Пылесос Vitek VT-1810',$wtf) - gives 0

  • strcmp('Пылесос Vitek VT-1810',$name) - for some reason 148.

Tried to use curl - nothing changes.

  • one
    I don’t know if it will help or not, but I consider the following characters for Russian strings: mb_strlen ('Vitek VT-1810 vacuum cleaner', 'UTF8'); // 21character - user190134
  • Tried, displays 78 and 21. - Ashley Nov.
  • it was like that the server gave me the data in cp1251, and I recoded them through iconv, then everything was ok ... - user190134
  • I tried it too, and nothing changes either :( - Ashley
  • 2
    The same strings cannot have different lengths. Print them byte-by-bye (you can even have hex-values ​​of bytes for clarity) and see the difference. - PinkTux

0