title: How can I remove a set of data from my results from my response from an API?
body: <p>I have a page <a href="http://theloftames.com/test/testphp1.php?search=bke" rel="nofollow">here</a> that if you sort by color or size (click on the headers) we have some data that is uncategorized. How can I filter this out? Would it be something similar to the <code>$activeonly</code> code (I got that code from a response here on Stack Overflow)? Here is my code:</p>
  
  <pre><code>&lt;?php
  
  $search = $_GET['search'];
  if ($search == "") {
      echo "Please enter a query. &lt;a href='/search.php'&gt;Click Here&lt;/a&gt; to go back";
    break;
  }
  else {
  $data = array('key' =&gt; $API_KEY,
                /*'consignorId' =&gt; '1',*/
                'query' =&gt; $search,
                'includeItemsWithQuantityZero' =&gt; 'false');
  
  $data_string = json_encode($data);
  
  $context = stream_context_create(array(
    'http' =&gt; array(
      'method' =&gt; "POST",
      'header' =&gt; "Accept: application/json\r\n".
            "Content-Type: application/json\r\n",
      'content' =&gt; $data_string
    )
  ));
  
  $result = file_get_contents('https://user.traxia.com/app/api/inventory', false, $context);
  
  
  $jsonData = $result;
  $phpArray = json_decode($jsonData, true);
  $phpArray = $phpArray['results'];
  $activeonly = array_filter($phpArray, function($active) { return $status['status']=="ACTIVE"; });
  $mykeys = array('name','sku','category','color','size','currentPrice');
  }
  ?&gt;
  
  &lt;div class="CSSTableGenerator"&gt; 
  &lt;table id="myTable" class="tablesorter"&gt;
       &lt;thead&gt;
          &lt;tr&gt;
             &lt;?php
          foreach($mykeys as $k) {
              if ($k == "name") {
                $k = "Name";
              }
              if ($k == "sku") {
                $k = "SKU";
              }
              if ($k == "category") {
                $k = "Category";
              }
              if ($k == "color") {
                $k = "Color";
              }
              if ($k == "size") {
                $k = "Size";
              }
              if ($k == "currentPrice") {
                $k = "Price";
              }
              echo "&lt;th style='cursor:pointer'&gt;$k&lt;img src='/test/images/UpDown.png' width='8px' height='auto' style='margin: 0px 20px'&gt;&lt;/th&gt;";
          }
          ?&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;?php
          foreach($phpArray as $key =&gt; $values) {
              echo '&lt;tr&gt;';
              foreach($mykeys as $k) {
                  $value = $k == "currentPrice" ? '$' . number_format($values[$k]/100,'2') : $values[$k];
                  echo "&lt;td&gt;" . $value . "&lt;/td&gt;";
              }
              echo '&lt;/tr&gt;';
          }
          ?&gt;
       &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks!</p>