title: CSS/PHP Changing Hover Colour Links
body: <p>I have a file that holds an array of navigation links, so that if I want to add a new link to the nav menu I can do it in one file rather than have to change multiple manually. However, each menu link (category) requires a different a:hover colour, but my current coding doesn't work.</p>
  
  <p>Here's the file where the menu items are stored, along with the colour that should be the a:hover colour in a multi-indexed array (some are left blank):</p>
  
  <pre><code>&lt;?php
  
  $CATEGORIES = array(
      array("culture", "#f9993c"),
      array("nature", "#59AF56"),
      array("science", "COLOUR"),
      array("society", "COLOUR"),
      array("technology", "COLOUR")
      );
  
  ?&gt;
  </code></pre>
  
  <p>Here's the file that prints the menu items:</p>
  
  <pre><code>&lt;?php
  
  $count_categories = count($CATEGORIES);
  $incr_categories = 0;
  
  while($incr_categories != $count_categories) {
      // Change main_right_sub a:hover
      echo "&lt;style&gt;#main_right_sub a:hover { color: ".$CATEGORIES[$incr_categories][1]."; } &lt;/style&gt;";
  
      // Print Nav Items
      echo "&lt;a href='category.php?cat?=".$CATEGORIES[$incr_categories][0]."'&gt;".strtoupper($CATEGORIES[$incr_categories][0])."&lt;/a&gt;";
  
      // Increment Count
      $incr_categories++;
      if ($incr_categories != $count_categories) {
          echo "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>I'm guessing you can't interchange a style like that, because all the links are coming out as "#59AF56" on mouseover, which is odd as that is the second colour in the multi-index array. Any help would be appreciated!</p>