Jehna :)

PHP 한글 깨짐 본문

윌리/System 이것저것

PHP 한글 깨짐

Jehna 2020. 2. 14. 00:43

"php에서 한글이 깨질 경우, "


1. header에 utf-8 선언

   

   header("Content-Type: text/html; charset=UTF-8");



  


2. Mysql 인코딩 지정

    - /etc/my.cnf 파일 수정 후, mysql 재시작

    

    [mysqld]

    character-set-server    = utf8mb4


    [client]

    default-character-set=utf8