I am getting my array values from database. and it is just names of users. Iam printing them as it as they are retrieved , I want to print them Alphabetical order of their names (Ascending Order). How can I do this ?
foreach($common_follows as $row) // $common_follows contains the IDs of users
{
$names=$obj2->get_user_name($row); //this function gets the name from user ID
while ($rows = mysql_fetch_assoc($names)) // For getting the name of the person being followed
{
sort($rows['name']); //Not seems to sort
echo '<img src="https://graph.facebook.com/'.$rows['user_id'].'/picture?type=normal" width="65" height="20" id="fbthumb">';
echo $rows['name']."<br>";
$count_common++;
}
}
That sort function does not seem to work , since at each loop iteration a single name is returned .
$common_followsarray.