<?php $arr = Array ( 0 => Array ( 'id' => 16059, 'product_id' => 4013, 'Product' => Array ( 'id' => 4013, 'name' => 'XYZ' ) ), 1 => Array ( 'id' => 16060, 'product_id' => 4462, 'Product' => Array ( 'id' => 4462, 'name' => 'MNOP' ) ), 2 => Array ( 'id' => 16061, 'product_id' => 4473, 'Product' => Array ( 'id' => 4473, 'name' => 'ABCD' ) ) ); $t = []; foreach ($arr as $key => $value) { $t[$key] = $value['Product']['name']; } array_multisort($t, SORT_ASC, $arr); print_r($arr);
You have javascript disabled. You will not be able to edit any code.