I am looping through all child pages of the current page. I am returning the results of the custom field 'bedrooms'. This is resulting in a list of numbers (numbers of bedrooms) like so - 131413. This is what I expect.
However I want to remove the duplicates so in the example above it will be returned as 134.
I've looked into arrays but and not the best when it comes to php so can anyone help please?
Here's my current code for the child loop and return of acf field.
<?php
$args = array(
'post_type' => 'property',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'orderby' => 'plot_number',
'order' => 'ASC'
);
$parent = new WP_Query( $args );
if ( $parent->have_posts() ) : ?>
<?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
<?php the_field('bedrooms'); ?>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>