title: Making groups inside array and connecting to jquery
body: <p>For example with the word 'stack' -></p>
  
  <p>The Main array:</p>
  
  <p><strong>MainArray</strong> = Array ( [0] => g [1] => g [<strong>2</strong>] => s [<strong>3</strong>] => t [<strong>4</strong>] => a [<strong>5</strong>] => c [<strong>6</strong>] => k [7] => d [8] => v [9]) </p>
  
  <p>The Array which holds the Position (key) of the word inside the other array</p>
  
  <p><strong>PositionArray</strong> = Array ( [0] => <strong>2</strong> [1] => <strong>3</strong> [2] => <strong>4</strong> [3] => <strong>5</strong> [4] => <strong>6</strong> )</p>
  
  <p>I want to group the position array values inside the main arrays keys. Myself I tought about the following:</p>
  
  <pre><code>echo $MainArray[PositionArray[0]];
  echo $MainArray[PositionArray[1]];
  echo $MainArray[PositionArray[2]];
  echo $MainArray[PositionArray[3]];
  echo $MainArray[PositionArray[4]];
  </code></pre>
  
  <p>But then still I did not make a group or something inside the other array, I only output the word 'stack' using the MainArray.</p>
  
  <p>I want this group because later on I will put My array in a tabel for example:</p>
  
  <p>g - g - s <br>
  t - a - c <br>
  k - d - v</p>
  
  <p>Then with Jquery I want that when I hover any letter of stack ( so the s, t, a, c or k) I want it to change the font color of the whole word stack. So for example if I hover 't' the word stack gets a differtent font color, and when I click it I want it to stay like that. </p>
  
  <p>I tried long acomplimishing this but I have yet to suceed so that is why I seek help here.</p>