3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "0" => [ "UserID" => "1", "EmailAddress" => "user5@gmail.com", "TransID" => "fjhf8f7848", "email" => "asdashdk@gmail.com" ], "1" => [ "UserID" => "1", "EmailAddress" => "johndoe@gmail.com", "TransID" => "dfsdhsdu78", "email" => "rrrrrrr@gmail.com" ], ]; foreach($arr as &$item){ uksort($item, function ($a, $b) { $a = strtolower($a); $b = strtolower($b); return strcmp($a, $b); }); } print_r($arr);

preferences:
19.93 ms | 407 KiB | 5 Q