title: Create an array() from ACF repeater
body: <p>I'm trying to create several arrays of data from a repeater. There are 3 columns to each row;</p>
  
  <ol>
  <li>bus_type</li>
  <li>band_food</li>
  <li>band_no_food</li>
  </ol>
  
  <p>The first col is TEXT and the other 2 are select lists.</p>
  
  <p>What I'd like to do is loop through the results and depending on the condition, store the "bus_type" value in an array whihc I can later use as a conditional statement. I thought something like this would work, but not having any luck;</p>
  
  <pre><code>$foo_a = array();
  $foo_b = array();
  
  if( have_rows('bus_type') ): while ( have_rows('bus_type') ) : the_row();
  
      if (get_sub_field('band_food') == 'a') {
          $foo_a[] = get_sub_field('bus_type');
      } else if (get_sub_field('band_food') == 'b') {
          $foo_b[] = get_sub_field('bus_type');
      }
  
  endwhile; endif;
  </code></pre>
  
  <p>Any ideas hows I would achieve the desired result?</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>OK, it looks like storing this as a VAR works. The final code would look like this;</p>
  
  <pre><code>if( have_rows('bus_type') ): while ( have_rows('bus_type') ) : the_row();
  
      $food_var = get_sub_field('band_food');
  
      if ($food_var == 'a') {
          $foo_a[] = get_sub_field('bus_type');
      } else if ($food_var == 'b') {
          $foo_b[] = get_sub_field('bus_type');
      }
  
  endwhile; endif;
  </code></pre>