关于yii2的中文乱码问题

在数据库配置中这么配就可以了

<?php

return [
    'class' => 'yiidbConnection',
    'dsn' => 'mysql:host=127.0.0.1; dbname=ohmycto; charset=utf8',
    'username' => 'website',
    'password' => 'mengde1B',
];
原文地址:https://www.cnblogs.com/turtle920/p/4967930.html