$arr["ins1.exe"] = "TDS1";
$arr["ins2.exe"] = "TDS2";
$arr["ins3.exe"] = "TDS3";
$arr["ins4.exe"] = "TDS4";
Under this example, yes, it's in the second position. However, under this example:
$arr["ins3.exe"] = "TDS3";
$arr["ins4.exe"] = "TDS4";
$arr["ins2.exe"] = "TDS2";
$arr["ins1.exe"] = "TDS1";
... it is in the third. Because it is an associative array, the key is the only reference to location the array understands.
If they were always retrieved in the same order, however, you could:
for ($i=0;$i<count($arr);$i++) {
if ($arr[$i] == "ins2.exe") {
echo($i);
}
}
However, this is not related to the key in any way, it's related to the order in which they are gathered.