0) { $cacheFile = $cacheFileName . $num++ . '.dat'; if (file_exists($cacheFile)) { $cfile = fopen($cacheFile, 'rb'); $content = fread($cfile, filesize($cacheFile)); fclose($cfile); fwrite($file, $content); } else { $num = -1; } } fclose($file); }