i need help in super permutation
i have 3 letters long string "fhd" i want to write each ones alternate in sindhi language but problem is that sindhi language has multiple alternates of each of above letter
so i have 3 list boxes one for each letter's alternates in sindhi each one for sindhi alterate letters and sounds of each string letter from "fhd"
f listbox have 3 items (alternate of f) which are ف، ڦ، په so list one represents alternates of F which are`=ف، ڦ، په items
list two have ح، ه، ھ alternate of h
list 3 have د، ڏ، ڊ alternates of D
the goal is to produce as many words as possible all containing three sindhi alternate letters containing 3 sindhi letters as alternate of english 'fhd'
what my path is write first alternate of f all the times list box f (first listbox) item counts
and in second side all other letters should be represented once
for h=0 to len {fahad}
first set as a=ف b=ه c=د second set as a=ف b=ح c=ڊ third set as a=ف b=ه c=ڏ، the words we made are فهد فحڊ فهڏ
you note ف is repeated all the three times till the third letter alternate of d د، ڊ، ڏis written all three times
the second bunch of words should be ڦهد ڦحڊ ڦهڏ here also second alternate of f ڦ is repeated all three times as usage of alternate of D ڊ، ڏ، د now the second letter h's alternate (which are two) each shold be reapated three times i mean the focus is second letter h's alternates فهد ڦهڊ فهڏ
then second alternate of have three times repeated
فحد ڦحڊ فحڏ
then first alternate of d=د فهد ڦحد فهد
then second alternate of d=ڊ،
فهڊ ڦحڊ فهڊ then third alternate of d=ڏ
فهڏ ڦحڏ ڦهڏ
actually i want to build roman translitration in this case there are more then one alterates of single english letter
i have database of sindhi words in back ground where i want to query all fhd's sindhi alternate words which one would be ok written in db that one replaced in sentences the word list which can be made as alternates of fhd should be
فهد فحڊ فهڏ
ڦحد ڦهڊ ڦحڏ
فهد ڦهڊ فهڏ
ڦحد فحڊ ڦحڏ
فهد ڦحد فهد
ڦحڊ فهڊ ڦحڊ
فهڏ ڦحڏ فهڏ this is the list i want to get, who can help me how to do it programettiaclly
i have done little plane but seems not working, can any or many may convert idea into real php programmng
this is the programing i have done for populating listboxes
<?php
global $servername;
global $username;
global $password;
global $dbname;
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "tsrs";
//////////////////////
global $q;
$q=array();
//////////////////////
for ($n=0; $n<=strlen("fahad"); $n++){
$i=substr("fahad", $n, 1);
//echo $i;
/////////////////////
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
mysqli_set_charset($conn,"utf8");
$sql = "SELECT * FROM duplicate WHERE engletter='$i' order by id";
$result = $conn->query($sql);
global $m;
$m=1;
if ($result->num_rows > 0) {
$altrntcount=$result->num_rows;
while($row = $result->fetch_assoc()) {
$q[$n][$m]=$row['sinletter'] ;
echo $q[$n][$m]."<BR>";
$m=$m+1;
}
}
}
echo "<form>";
for ($n=0; $n<=strlen("fahad"); $n++){
$list[$n]="list".$n;
echo $list[$n];
echo "
<select name=\"".$list[$n]."\">";
for ($m=0; $m<=$altrntcount; $m++){
if ($q[$n][$m]<>""){
echo "<option value=\"".$q[$n][$m]."\">".$q[$n][$m]."</option>";
}
}
echo "</select>";
}
echo "</form>";
?>
here is the further idea way but needs logical help to run
for n-0 to len(fhd)
for x=0 to 5 loop...... the maximum alternates of any english letter in sindhi are 5
for w=0 to len(fhd)
for m-0 to 5 looop
if m=>list(w).countitems then
h=0
word(q)(c)=word(q)(c)+list(w).selectedindex=h
h=h+1
end if
//m=m+1
w=w+1
loop
loop
if m=>5 then
x=x+1
end if
if w=>len(fhd)
n=n+1
end if
if x=>list(n).countitems then
p=0
word(q)=word{q}+list(n).selectedindex=p
p=p+1
end if
loop
loop