function sortBasedOnBusFrequency($SortArray)
{
    //print_r($SortArray);//bugtest
    $array_size = sizeof($SortArray);
    //$arrFrequency=getAllBusFrequency();
    for ($x = 0; $x < $array_size; $x++) {
        for ($y = 0; $y < $array_size; $y++) {
            if (getBusFrequencyScore($SortArray[$x]) > getBusFrequencyScore($SortArray[$y])) {
                $hold = $SortArray[$x];
                $SortArray[$x] = $SortArray[$y];
                $SortArray[$y] = $hold;
            }
        }
    }
    //echo "After sorting";
    //print_r($SortArray);
    return $SortArray;
}
Beispiel #2
0
function sortBasedOnBusFrequency($SortArray)
{

	$array_size=sizeof($SortArray);
	
	$arrFrequency=getAllBusFrequency();


	for($x = 0; $x < $array_size; $x++) 
		{
			
			for($y = 0; $y < $array_size; $y++) 
				{
					if(getBusFrequencyScore($arrFrequency,$SortArray[$x]) > getBusFrequencyScore($arrFrequency,$SortArray[$y])) 
						{
						  $hold = $SortArray[$x];
						  $SortArray[$x] = $SortArray[$y];
						  $SortArray[$y] = $hold;
						}
				}
		}
	return $SortArray;

}