Uygun glob kullanımı ()

0 Cevap

Bu () ben sunucuda TestFolder klasörü için bir harf duyarsız arama yapmak için çalışıyorum bize topak için doğru yoldur.

$chid = "testFoLdER";
$dirchk2 = "/temp/files/" . glob('".$chid."') . "/" . $data[1] . ".doc";

@code_burgar I made these changes to apply to the example code_burgar showed me. is this correct? what i'm trying to do here is what ever globistr find for casing, rename the folder to lowercase.

$chid = (strtolower($_POST['chid']));
$findbatch = globistr($chid);
$results = glob($findbatch);

if ( !empty($results) ) {
  $result = $results[0];
  rename("/temp/files/" . $results . "/", "/temp/files/" . strtolower($chid) . "/");
} 
else 
{
    $missing_dir = 'Folder containing files, Not Found: ' . $chid . "\r";
    $errfile = fopen("/rec/" . $chid . "-errlog.txt", "a");
        fwrite($errfile, $missing_dir . "\n");
        fclose($errfile);
        exit();                           
}

0 Cevap