IF语句不止一个函数

I have a predefined number using the variable $leftoshownumber, and I have

$removedouble = ["Parking Available", "Reduced Summer Rent Available", "Garden"];

Which removes any doubles from the array, because I have manually picked them out to be first in my list. It's working correctly and does remove the double, but it means it doesn't give out the $leftoshownumber. Because when it matches one it simply removes it.

Is there a way for me at this point if(in_array ($data->Name,$removedouble)) continue; when it matches a double and removes it to simply add a another digit to $leftoshownumber. So I always have 6 output?

This is a snippet of the section.

$datas = array_slice($facilities, 0, $leftoshownumber);
usort($datas, "cmp");

foreach($datas as $data) {
    if(in_array ($data->Name,$removedouble)) continue; 
        echo '<div class="checkmark-33"><div class="fa-stack fa-1x checkmark-icon"><i class="fa fa-circle fa-stack-2x icon-background"></i><i class="fa fa-check fa-stack-1x icon-text"></i></div><div class="checkmark-inner">'. $data->Name .'</div></div>'; 
}; 

Thanks!

Sure, just replace the continue with an if/else statement:

$datas = array_slice($facilities, 0, $leftoshownumber);
usort($datas, "cmp");

foreach($datas as $data) {
    if(in_array ($data->Name, $removedouble)) {
        // echo whatever you want here
    } else { 
        echo '<div class="checkmark-33"><div class="fa-stack fa-1x checkmark-icon"><i class="fa fa-circle fa-stack-2x icon-background"></i><i class="fa fa-check fa-stack-1x icon-text"></i></div><div class="checkmark-inner">'. $data->Name .'</div></div>';
    }
};