I am using `php 7.3` and I am calculating the similarity of posts.

```
<?php

$posts = [
    'post_count' => 3,
    'posts' => [
        [
            'ID' => 1,
            'post_content' => "Wrong do point avoid by fruit learn or in death. So passage however besides invited comfort elderly be me. Walls began of child civil am heard hoped my. Satisfied pretended mr on do determine by.",
        ],
        [
            'ID' => 2,
            'post_content' => "Lorem ipsum dolor sit"
        ],
        [
            'ID' => 3,
            'post_content' => "Months on ye at by esteem desire warmth former. Sure that that way gave any fond now. His boy middleton sir nor engrossed affection excellent."
        ],
        [
            'ID' => 4,
            'post_content' => "Lorem ipsum dolor sit"
        ],
    ]
];

print_r($posts);

function getNonSimilarTexts($posts)
{
    $similarityPercentageArr = array();

    for ($i = 0; $i <= $posts['post_count']; $i++) {
        // $posts->the_post();
        $currentPost = $posts['posts'][$i];
        if (!is_null($currentPost['ID'])) {
            for ($y = 0; $y <= $posts['post_count']; $y++) {
                $comparePost = $posts['posts'][$y];
                if (!is_null($comparePost['ID'])) {
                    similar_text(strip_tags($currentPost['post_content']), strip_tags($comparePost['post_content']), $perc);
                    // similarity is 100 if self compare
                    if ($perc != 100) {
                        array_push($similarityPercentageArr, [$currentPost['ID'], $comparePost['ID'], $perc]);
                    }
                }
            }
        }
    }
    return $similarityPercentageArr;
}

$p = getNonSimilarTexts($posts);
print_r($p);

```

As you can see, I am getting as an output an array with the `[[ID, ID, similarity_percentage],...]`

I would like to filter this array and take out all similarities that are `>20%` and furthermore, I would like to keep only 1 similar post and remove the ohters. My wanted result are the post IDs: `1,2,3`

Any suggestions how to filter the array like this?