2

I send the headers for Cache and Content Type for different languages to show the correct characters, but it does not work.

header('Cache-control: private; Content-Type:text/html; charset=UTF-8');

What am I doing wrong?

1 Answer 1

3

You can't send multiple headers in one header() call. Split it like that:

header('Cache-control: private;');
header('Content-Type:text/html; charset=UTF-8');

Generally, when you send headers, you separate them by new lines, but if you try to do this with PHP's header() function, you get warning:

Header may not contain more than a single header, new line detected

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.