if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$filtro = strlen($entry);
if ($filtro == 16) {
// echo $filtro.'
';
//echo $entry.'
';
$anio = substr($entry,0,4);
$mes = substr($entry,4,2);
$dia = substr($entry,6,2);
$orden = substr($entry,9,3);
$file = substr($entry,0,12);
// echo $anio.' - '.$mes.' - '.$dia.' + '.$orden.'
';
echo "INSERT INTO `webcam` VALUES ('', '".$file."', 's', '".$anio."', '".$mes."', '".$dia."', '10', '00', '".$orden."', '', '1', '1', '', '1100', '0', '0', '0');
";
}
}
}
closedir($handle);
}
?>