$userData = [ ['name' => 'John', 'age' => 30, 'email' => 'john@email.com'], ['name' => 'Jane', 'age' => 25, 'email' => 'jane@email.com'], ['name' => 'Steve', 'age' => 35, 'email' => 'steve@email.com'], ];
use yii\helpers\ArrayHelper; ArrayHelper::multisort($userData, ['age', 'name']);
[ ['name' => 'Jane', 'age' => 25, 'email' => 'jane@email.com'], ['name' => 'John', 'age' => 30, 'email' => 'john@email.com'], ['name' => 'Steve', 'age' => 35, 'email' => 'steve@email.com'], ]The Yii2 ArrayHelper class is part of the yii2-helpers package, which is included as part of the core Yii2 Framework.