Yii2 page garbled solution:
Just configure the encoding format in the database configuration:
<?php return [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=127.0.0.1; dbname=ohmycto; charset=utf8', 'username' => 'website', 'password' => 'mengde1B', ];
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!