try it
header('Content-Type: text/html; charset=utf-8');
It is also sometimes necessary to clarify that the user sends / waits for UTF-8 encoded data when connecting to the database, so MySQL believes that it should process the encoded latin1 data and convert it accordingly. Run the SET NAMES utf8 command after connecting to db
Please let me know if it still does not work.
source share