<?php
$missing = ['CanonPixmaE510', 'epsonpaderror', 'epson-pm', 'BrotherMFC-L2700DW', 'CLJ4700-CP4005ITBreset1', 'CLJ4700-CP4005ITBreset'];
$base = 'https://printerservis.net/';
$paths = ['images/', 'img/', ''];
$exts = ['jpg', 'jpeg', 'png', 'gif', 'webp'];

foreach ($missing as $name) {
    $found = false;
    foreach ($paths as $path) {
        foreach ($exts as $ext) {
            $url = $base . $path . $name . '.' . $ext;
            $ctx = stream_context_create(['http' => ['timeout' => 3, 'method' => 'GET']]);
            $hdrs = @get_headers($url, 0, $ctx);
            if ($hdrs && strpos($hdrs[0], '200') !== false) {
                echo "FOUND: $url\n";
                $found = true;
                break 2;
            }
            $lname = strtolower($name);
            $url2 = $base . $path . $lname . '.' . $ext;
            $hdrs2 = @get_headers($url2, 0, $ctx);
            if ($hdrs2 && strpos($hdrs2[0], '200') !== false) {
                echo "FOUND: $url2\n";
                $found = true;
                break 2;
            }
        }
    }
    if (!$found) echo "NOT FOUND: $name\n";
}
