Accessing a multidimensional array

So I have an array that stores a deck of cards by suite and has an image path for each card:
[php]
$deck = array (
$hearts = array (
“ace”, “001h.gif”,
“two”, “002h.gif”,
“three”, “003h.gif”,
“four”, “004h.gif”,
“five”, “005h.gif”,
“six”, “006h.gif”,
“seven”, “007h.gif”,
“eight”, “008h.gif”,
“nine”, “009h.gif”,
“ten”, “010h.gif”,
“jack”, “011h.gif”,
“queen”, “012h.gif”,
“king”, “013h.gif”
),
[/php]

and likewise, with one inner array for each suite.

Now, I’m attempting to list only the aces like this:

[php]
foreach ($deck as $key => $val)
{
for ($i = 1; $i < sizeof($val); $i+=26)
{
print “The file name for the ace of " . $key . " is .” . $val[$i] . “<img src=“cardImages/”.$val[$i].”" />
";
}
}
[/php]

It works alright, but how can I get $key to display the NAME of the suite rather than its index value? It’s stumping me!

Sponsor our Newsletter | Privacy Policy | Terms of Service