First, it's list($key, $val), not the other way around.
Second, this does work:
$myarray[$val] = $key;
echo "MyArray: $myarray[$val]<BR>";
although it is better to write it as:
echo "MyArray: ".$myarray[$val]."<BR>";
You may want to put this at the top of your script:
error_reporting(E_ALL);
// this works though>>
echo "$val=>$key<BR>";
Ofcourse it does :-)