I want to create a title description for a chess eco code:
This is the lookup array in php named eco_codes:
 <?php
 $eco_tmp = array(
 "A00" => "Uncommon Opening 1.g4, a3, h3, etc.",
 "A01" => "Nimzovich-Larsen Attack 1.b3",
 "A02" => "Bird's Opening 1.f4",
 "A03" => "Bird's Opening 1.f4 d5")
 ?>
I have the lookup code (ex. GameECO = "A02") like this:
 <span id="GameECO"></span> 
What I want is this:
 <?php $key = array_search($val['GameECO'], $eco_codes);?>
 <span id="GameECO" title = "<?php echo $key.$val['ECO']></span> 
How can I proceed? Is php even required for this? Maybe js alone would do it?
my page is http://communitychessclub.com/basic.php?game=5312
 
    