title: Is there a way to display numerical values in a foreach loop as "Min - Max"?
body: <p>I'm using the ACF post object field to display multiple Woocommerce products as post type items. However, I'm trying to only display the prices of these selected products as a min/max price range (eg. $21.95 - $58.50).</p>
  <p>Here is the code I'm using for the loop but it just shows every price. Is there a way to just show the lowest and highest price as a price range?</p>
  <pre><code>&lt;?php
  $linked_products = get_field('linked_products');
  if( $linked_products ): ?&gt;
      &lt;?php foreach( $linked_products as $post ): 
          setup_postdata($post); ?&gt;
          &lt;?php $product = wc_get_product( $post ); $prices = $product-&gt;get_price_html(); echo $prices; ?&gt;
      &lt;?php endforeach; ?&gt;
  &lt;?php 
  wp_reset_postdata(); ?&gt;
  &lt;?php endif; ?&gt;
  </code></pre>