Friday, 14 December 2018

html - Set HTTP header to UTF-8 using PHP

I have several PHP pages echoing out various things into HTML pages with the following code.




However, when I validate using the W3C validator it comes up with:



The character encoding specified in the HTTP header (iso-8859-1) is different from the value in the element (utf-8).



I am quite new to PHP, and I was wondering if I could and should change the header for the PHP files to match the HTML files.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...