A
A
alex5e2015-09-25 02:25:43
PHP
alex5e, 2015-09-25 02:25:43

The str_replace function cuts Cyrillic. How to fix?

On the local server, when calling the str_replace function, there are no problems; on the production server, the Cyrillic alphabet disappears from the final string. Someone faced a similar problem? Tell me how to fix it? iconv doesn't help. Transfers were made by Unix (LF) everywhere and did not help either

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2015-09-25
@alex5e

if you explain it in a simple way: the problem is in the difference between the encoding of the code and the lines
that come from the side (db/scraping/http requests/etc).
accordingly, they must be brought to the same denominator.
example script in UTF-8 and string in WIN-1251.

O
onefinal, 2015-09-25
@onefinal

mb_ereg_replace
php.net/manual/en/function.mb-ereg-replace.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question