Tranquillo.
Cambia questo header("Content-Type: application/json; charset=UTF-8"); in header("Content-Type: text/plain; charset=UTF-8");