this is my main code
<?php
include 'qwerty.php';
$words = array();
$order = array('q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m');
$key = array();
//for added val keys
$abc = array ("a","b","c","d");
$text = "class top clone house apple blue";
$words = explode(" ",$text);
$flag ="";
for($i=0,$j=count($words);$i<count($words);$i++,$j--){
$add_value = 0;
$next_word = $words[$i];
$fletter_nextword = Qwerty::get_first_letter($next_word);
echo $fletter_nextword."<br/>";
if(!in_array($fletter_nextword,$order)){
echo "there's a number in a string";
$flag="FALSE";
break;
}
else{
$key_nextword = Qwerty::get_key($fletter_nextword,$order);
echo $key_nextword.'<br/>';
if(in_array($key_nextword,$key)){
$key[$i] = $key_nextword.'b';
$flag = "TRUE";
}
else{
$key[$i] = $key_nextword.'a';
$flag = "TRUE";
}
}
}
if($flag!="FALSE"){
$words_key = array_combine($key,$words);
ksort($words_key);
foreach ($words_key as $key => $value){
echo $value.' '.$key.'</br>';
}
}
?>
the problem is, when I'm trying to sort these words by the assigned array, what happen is
EXAMPLE:
close and class does have same first letter which means, I assigned it already that if the word starts with letter c
the key should be is 21
this is according to the qwerty order what happen with the words close and class...
close will not be included in the printed words in a sort out qwerty order /:
how to put up extra added key with the same key in it?