1<?php
2
3$data=[
4 ['name'=>'Tamil',"distance"=>44],
5 ['name'=>'Tamil',"distance"=>4],
6 ['name'=>'Tamil',"distance"=>14],
7 ['name'=>'Tamil',"distance"=>24],
8 ['name'=>'Tamil',"distance"=>10]
9];
10
11 for($i=0;$i<count($data);$i++)
12 {
13 for($j=$i;$j<count($data);$j++)
14 {
15 if($data[$i]['distance']>$data[$j]['distance'])
16 {
17 $temp=$data[$i];
18 $data[$i]=$data[$j];
19 $data[$j]=$temp;
20 }
21 }
22 }
23
24 print_r($data);
25
26#tamilarasan nallairsun