$allowed = ['zip', 'rar', '7z', 'gz', 'archive', 'A
$lc_allowed = array_map('strtolower', $allowed);

$tests = [
    ['MyData.a
    ['MyData.tar.Gz',true],
    ['MyData.gzip',false],
    ['MyData.7z.backup',false],
    ['MyData...',false],
    ['MyData',false],
    ['archive.tar.gz', true]
];

foreach ($tests as $test) {
    $ext = pathinfo($test[0], PATHINFO_EXTENSION);
    if (in_array(strtolower($ext), $lc_allowed)) {
        $result = 'true';
    } else {
        $result = 'false';
    }
    printf(, $test[0],$result);
}