title: How to display a form answer if it matches the answer in an array in php
body: <p>I've been trying to learn php and to practice, I made an array of Family Guy characters based off the last name. Then I tried asking a question in the form and I wanted the code to check the array to see if it matches the correct answer in the array. I'm still very new to PHP, this is really just a learning experience. The code looks like this...</p>
  
  <pre><code>&lt;?php
  $families = array(
  "Griffin" =&gt; array(
  "Peter",
  "Louis",
  "Chris",
  "Stewie",
  "Meg"
  ),
  "Quagmire" =&gt; array(
  "Glen"
  ),
  "Brown" =&gt; array(
  "Cleveland",
  "Loretta",
  "Junior"
  )
  );
  
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Which of these Family Guy Characters is part of the Griffin family?
  &lt;form action = "familyguyquestions.php" method = 'post'&gt;
  A: &lt;input type = "radio" name = "cleveland"&gt;Cleveland
  B: &lt;input type = "radio" name = "glenn"&gt;Glenn
  C: &lt;input type = "radio" name = "meg"&gt;Meg
  D: &lt;input type = "radio" name = "quagmire"&gt;Quagmire
  &lt;input type = "submit" name = "submitQuestion"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>