array_diff

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Computes the difference of arrays
<?php array_diff(array $array, array ...$arrays): array
<?php     $dir = __DIR__.'/../../.peck-test.cache';



    if (is_dir($dir)) {

        foreach (array_diff(scandir($dir), ['.', '..']) as $file) {

            unlink("{$dir}/{$file}");

        }
<?php     $dir = __DIR__.'/../../.peck-test.cache';



    if (is_dir($dir)) {

        foreach (array_diff(scandir($dir), ['.', '..']) as $file) {

            unlink("{$dir}/{$file}");

        }