Usas While
Código PHP:
Ver original<?php
$desde=0001;
while($desde<=6018)
{
?>
<input type="text" name="doc" value="
<?php if (@file_get_contents('http://www.web.com/archivo<?=$desde?>.doc')) echo 'SI'; else echo 'NO';?>" />
<input type="text" name="tiff" value="
<?php if (@file_get_contents('http://www.web.com/archivo<?=$desde?>.tif')) echo 'SI'; else echo 'NO';?>" />" />
<?php
$desde++;
}
?>
Pero como son muchos archivos, te va tirar error en time OUt.
+Informacion sobre bucles:
http://www.marcofbb.com.ar/tipos-de-bucles-en-php/