<?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);
You have javascript disabled. You will not be able to edit any code.