How can I make an array of all lists length x of the numbers 0 and 1?
<p>I need to create an array like this: </p>

<pre><code>$array = array(array(1,1,1,0,0,0,1,1), array(1,1,1,1,0,0,1,0));
</code></pre>

<p>but with all combinations of 1 and 0.</p>

<p>I wish to do this automatically, so I was thinking a for loop would be the best idea. 
In other words the inner arrays should be all combos like 0,0,0,0,0,0,0,0 then 0,0,0,0,0,0,0,1 then 0,0,0,0,0,0,1,0 then 0,0,0,0,0,0,1,1. for all combos.
I started like this:</p>

<pre><code>$array = array();
for($i =0;$i&lt;100; $i++){
$array[$i] = 0;
}
</code></pre>

<p>How do I get this to do what I am trying to do?</p>
