Last Updated: February 25, 2016
·
333
· not-only-code

special chars in HTTP/1.1 from php header()

if you try to do this:

<?php
// working on UTF-8
header("HTTP/1.1 200 OK válid");
?>

Will not work, you will receibe:

200 OK válid

So you must to decode UTF-8 first, something like:

<?php
// working on UTF-8
header(utf8_decode("HTTP/1.1 200 OK válid"));
?>