i have a string like
$email= "[email protected],[email protected],[email protected]";
first i explode this like
$wordChunks = explode(",", $email);
for($i = 0; $i < count($wordChunks); $i++){
$eex = mysqli_query($database->connection,"SELECT * FROM contacts where email = '$wordChunks[$i]' and owner = '$session->username'") or die(mysqli_error());
while($zzz = mysqli_fetch_array($eex)){
if(empty($zzz['bedrijfsnaam'])){
$aa = "<font size='2'>".ucfirst($zzz['name'])." ".ucfirst($zzz['lastname'])."</font>";
}else{
$aa = "<font size='2'>".ucfirst($zzz['bedrijfsnaam'])."</font>";
}
echo $aa;
}
}
The question is how can i order $aa in alphabetic order
What i tried is
$array = str_split($aa, 1);
sort($array);
foreach ($array as $val) {
echo $val."<br>";
}
But this orders only the string in $aa; example string = hellow output is ehllow. but i want order the output of $aa in the while loop