hi
try this:
$what[0]="11";
$what[1]="2";
$what[2]="31";
$what[3]="4";
$what[4]="51";
$what[5]="6";
$what[6]="71";
$with[0]="a";
$with[1]="b";
$with[2]="c";
$with[3]="d";
$with[4]="e";
$with[5]="f";
$with[6]="g";
$where[0]="11";
$where[1]="21";
$where[2]="31";
$where[3]="41";
$where[4]="51";
$where[5]="61";
$where[6]="71";
$qc=count($what);
$ic=count($where);
for($i=0;$i<$ic;$i++)
{
for($q=0;$q<$qc;$q++)
{
if($where[$i]==$what[$q]) $where[$i]=$with[$q];
}
}
for($i=0;$i<$ic;$i++) echo $where[$i]."<br>";
hth
chris