Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Time to nest some foreach loops!</p> <pre><code>&lt;?php $array1 = array('rough', 'smooth', 'coarse'); $array2 = array('shiny', 'matte'); $array3 = array('very large', 'large', 'medium', 'small'); foreach($array1 as $i) foreach($array2 as $j) foreach($array3 as $k) $output[] = "$i, $j, $k"; var_dump($output); /* ouput array 0 =&gt; string 'rough, shiny, very large' (length=24) 1 =&gt; string 'rough, shiny, large' (length=19) 2 =&gt; string 'rough, shiny, medium' (length=20) 3 =&gt; string 'rough, shiny, small' (length=19) 4 =&gt; string 'rough, matte, very large' (length=24) 5 =&gt; string 'rough, matte, large' (length=19) 6 =&gt; string 'rough, matte, medium' (length=20) 7 =&gt; string 'rough, matte, small' (length=19) 8 =&gt; string 'smooth, shiny, very large' (length=25) 9 =&gt; string 'smooth, shiny, large' (length=20) 10 =&gt; string 'smooth, shiny, medium' (length=21) 11 =&gt; string 'smooth, shiny, small' (length=20) 12 =&gt; string 'smooth, matte, very large' (length=25) 13 =&gt; string 'smooth, matte, large' (length=20) 14 =&gt; string 'smooth, matte, medium' (length=21) 15 =&gt; string 'smooth, matte, small' (length=20) 16 =&gt; string 'coarse, shiny, very large' (length=25) 17 =&gt; string 'coarse, shiny, large' (length=20) 18 =&gt; string 'coarse, shiny, medium' (length=21) 19 =&gt; string 'coarse, shiny, small' (length=20) 20 =&gt; string 'coarse, matte, very large' (length=25) 21 =&gt; string 'coarse, matte, large' (length=20) 22 =&gt; string 'coarse, matte, medium' (length=21) 23 =&gt; string 'coarse, matte, small' (length=20) */ ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload