0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHPの文字コードの変更に対応させる

Posted at

charsetが[shift-jis]や[euc-jp]になっている場合。
php5.6からは、サポートしてくれない。

しかし、あらかじめデフォルトの文字コードを変更することで対応できる。

PHPの文字コードの変更

php.iniを探す

phpの環境で
phpinfo();を見る。

Configuration File (php.ini) Path

の右側にあるディレクトリにphp.iniがある

php.iniを変更する

;default_charset = "UTF-8"
default_charset = "EUC-JP"

反映させる

phpやMAMPを再起動させれば反映されているはず。
私の環境では、これで文字化けが解決した。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?