'mysql:host=127.0.0.1;dbname=ohmycto;charset=utf8',"."/> 'mysql:host=127.0.0.1;dbname=ohmycto;charset=utf8',".">

Home >PHP Framework >YII >Solution to garbled yii2 page

Solution to garbled yii2 page

尚
Original
2019-12-07 11:02:012869browse

Solution to garbled yii2 page

Yii2 page garbled solution:

Just configure the encoding format in the database configuration:

<?php

return [
    &#39;class&#39; => &#39;yii\db\Connection&#39;,
    &#39;dsn&#39; => &#39;mysql:host=127.0.0.1; dbname=ohmycto; charset=utf8&#39;,
    &#39;username&#39; => &#39;website&#39;,
    &#39;password&#39; => &#39;mengde1B&#39;,
];

Recommended: yii usage tutorial

The above is the detailed content of Solution to garbled yii2 page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn