php echo random value from text fields
<p>I want to post all text box responses to results.php and then randomly choose one of the responses to display.</p>

<p>the form:</p>

<pre><code>&lt;form action="results.php" method="post"&gt;
&lt;input maxlength="30" name="friend[]" size="30" type="text" placeholder="Enter an option" /&gt;
&lt;input maxlength="30" name="friend[]" size="30" type="text" placeholder="Enter an option" /&gt;
&lt;input maxlength="30" name="friend[]" size="30" type="text" placeholder="Enter an option" /&gt;
&lt;input maxlength="30" name="friend[]" size="30" type="text" placeholder="Enter an option" /&gt;
&lt;input type="submit" value="Submit" /&gt;
</code></pre>

<p></p>

<p>the php contents (obviously wrong, but something like this?)</p>

<pre><code>foreach ($_POST['friend'] as $value) {          
    if ($value) {
      echo mt_rand($value);
    }
}
</code></pre>
