title: Why is my PHP multi dimensional array not working?
body: <p>My multi-dimensional array is working. But I cannot seem to use <code>explode</code> or <code>in_array</code> to limit the array when calling via <code>$_GET</code></p>
  
  <pre><code>&lt;?
  $shop = array(
  array("red", "black", "blue", "green"),
  array("orange"),
  array("orange", "black"),
  array("pink", "yellow")
  );
  
  foreach ($shop as $rowNumber =&gt; $row)
  {
      echo "&lt;li&gt;&lt;b&gt;The row number $rowNumber&lt;/b&gt;";
          echo "&lt;ul&gt;";
          foreach ($row as $col) {
              if (in_array($col, explode(' and ', $_GET['filter']))){
                  echo "&lt;li&gt;".$col."&lt;/li&gt;";
              }
          }
          echo "&lt;/ul&gt;";
      echo "&lt;/li&gt;";
  }
  
  ?&gt;
  </code></pre>
  
  <p>If I run the script with <code>$_GET["filter"]=="black"</code> it displays all items - it should only display two, example this is wrong: the other rows should not appear:</p>
  
  <p><img src="https://i.stack.imgur.com/6zD07.png" alt="enter image description here"></p>
  
  <p>should be this instead</p>
  
  <p><img src="https://i.stack.imgur.com/gGA1u.png" alt="enter image description here"></p>