title: Turning an array element into a link, which acts like a "POST" method in a form.
body: <p>I have a webpage which contains a form, like the following:</p>
  
  <pre><code>&lt;Form action=”search.php” method=”POST”&gt;
  &lt;fieldset&gt;
  &lt;legend&gt; Enter your search below &lt;/legend&gt;
  &lt;textarea name=”query”&gt; &lt;/textarea&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The users text is read from <code>query</code> and search results are displayed using code in the following section:</p>
  
  <pre><code>if ($_POST['query'])
  {
  //Users query is read and results from a search API are displayed
  }
  </code></pre>
  
  <p>The next thing that happens is that a list of synonyms are generated,  stored in a multidimensional array called <code>$synonyms</code> which I have displayed in a left-hand-navigation bar, using the code shown below. <code>$newline</code> prints a newline (as the variable name suggests)  </p>
  
  <p>Example of a <code>$synonyms</code> array:</p>
  
  <pre><code>array(3) 
  { [0]=&gt; array(2) 
      { [0]=&gt; string(9) "chelonian" 
        [1]=&gt; string(17) "chelonian reptile" } 
  
   [1]=&gt; array(6) 
  { [0]=&gt; string(7) "capsize" 
    [1]=&gt; string(11) "turn turtle" 
    [2]=&gt; string(8) "overturn" 
    [3]=&gt; string(9) "turn over" 
    [4]=&gt; string(8) "tip over" 
    [5]=&gt; string(9) "tump over" } 
  
   [2]=&gt; array(4) 
   { [0]=&gt; string(4) "hunt" 
     [1]=&gt; string(3) "run" 
     [2]=&gt; string(9) "hunt down" 
     [3]=&gt; string(10) "track down" } 
  
  }
  </code></pre>
  
  <p>Code used to output the array:</p>
  
  <pre><code>foreach ($synonyms as $test)
  {   foreach ($test as $test2)
      {
      echo $test2.$newline.$newline;
      }
  }
  </code></pre>
  
  <p>What I want to happen is:</p>
  
  <p>Turn each synonym into a clickable link..if the user clicks the synonym "capsize", the word capsize is sent to the section where the synonym(previously <code>query</code>) is read and processed into results.. ie. back to this section: </p>
  
  <pre><code>if ($_POST['query'])
  {
  // Synonym is read and results from a search API are displayed
  // Previously 'query' was read here
  // The cycle continues again
  }
  </code></pre>
  
  <p>Any ideas or suggestions on this one would be great, thanks guys.</p>