title: PHP Array Checking Not Working
body: <p>I have an array of booleans, and I want to check them if they're all <code>TRUE</code> to generate a button, if not then nothing. However, I always see the button and when I press on it, it doesn't do anything, even when it is supposed to do something.</p>
  
  <p>Please find the code below:</p>
  
  <p>The following code is where I have the array, its <code>index.php</code></p>
  
  <pre><code>&lt;?php
  
  session_start();
  
  session_unset();
  session_destroy();
  
  $_SESSION["contestant_name"]["topics_done"] = array( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE ); // topics done
  $_SESSION["contestant_name"]["topics_score_correct"] = array();
  $_SESSION["contestant_name"]["topics_score_wrong"] = array();
  $_SESSION["contestant_name"]["correct"] = 0;
  $_SESSION["contestant_name"]["wrong"] = 0;
  
  ?&gt;
  </code></pre>
  
  <p>And the next code is from <code>choosetopic.php</code></p>
  
  <pre><code>&lt;?php
  }
  
  print_r($_SESSION["contestant_name"]["topics_done"]);
  
  if (checkIfAllTrue($_SESSION["contestant_name"]["topics_done"])) {
  ?&gt;
          &lt;button onclick="complete.php"&gt;finish&lt;/button&gt;
  &lt;?php
  }
  
  function checkIfAllTrue ($arr) {
      for($i = 0; $i &lt; count($arr); $i++) {
          if (!$arr[$i])
              return FALSE;
      }
  
      return TRUE;
  }
  
  ?&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I always see the button. What is making this happen? It is supposed to see if the array is all <code>TRUE</code>s then it should add the button and when pressed, goes to <code>complete.php</code>, however, I always see the button, and even after finishing all the topics, and I press it, nothing happens.</p>
  
  <p>Thanks</p>