Answer the question
In order to leave comments, you need to log in
How to choose the right encoding when converting from a php file to html?
Good evening.
I have a php file that receives information from a server. I need to save this file in html. There is one problem: the text on the page is in Ukrainian. When converting with the ob_start(), ob_end_flush() and ob_get_contents() pods, the encoding is converted to utf-8 and the text is displayed as characters.
How to set up the encoding correctly?
What classes can perform this task?
Answer the question
In order to leave comments, you need to log in
iconv("windows-1251", "UTF-8", $html);
where in $html is the text in the encoding you want to change..
An article from our blog will remove all questions, I think: Data Encoding: A Guide to UTF-8 for PHP and MySQL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question