title: Php: check if array is all true
body: <p>I'm trying to shorten my code and I thought using array is the best way.</p>
  
  <p>This code is made pretty much of many different queries (mysqli) like this:</p>
  
  <pre><code>$a = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $b = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $c = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $d = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $e = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $f = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $g = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $h = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $i = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $j = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $k = $this-&gt;db-&gt;query("DELETE * FROM ....");
  </code></pre>
  
  <p>To check if this queries are correctly executed I do this (as they will return true/false):</p>
  
  <pre><code>if($a &amp;&amp; $b &amp;&amp; $c &amp;&amp; $d &amp;&amp; $e &amp;&amp; $f &amp;&amp; $g &amp;&amp; $h &amp;&amp; $i &amp;&amp; $j &amp;&amp; $k){
      //action    
  } 
  </code></pre>
  
  <p>But every time I've to add a query I've to add it to the if statement and it gets so long I don't know if I included it or not...</p>
  
  <p>So, now I'm thinking of doing this with arrays:</p>
  
  <pre><code>$a[0] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[1] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[2] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[3] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[4] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[5] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[6] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[7] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[8] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[9] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  $a[10] = $this-&gt;db-&gt;query("DELETE * FROM ....");
  
  if($a === true){
      //ok
  }else{
      //notok;
  }
  </code></pre>
  
  <p>But this code (if statement) doesn't work...
  What am I doing wrong?</p>