Ok, il fatto è che ordina in modo sbagliato.
Fai così:
Codice PHP:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nuova pagina 1</title>
</head>
<body>
<?php
$arrayfile = Array();
function ordina($file1,$file2)
{
$tempo1 = explode('_',$file1);
$tempo1 = $tempo1[3];
$tempo2 = explode('_',$file2);
$tempo2 = $tempo2[3];
return ($tempo1 < $tempo2) ? 1 : -1;
}
if ($handle = opendir('http://www.parapendionline.com/images/'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..") {
$arrayfile[]=$file;
}
}
closedir($handle);
usort($arrayfile,'ordina');
}
?>
<HTML>
<HEAD>
<TITLE>webcam</TITLE>
<SCRIPT language="JavaScript">
function doRefresh() {
// refresh della pagina corrente
document.location.reload();
}
// imposto il timeout per il prossimo refresh
// espresso in millisecondi (1000 = 1 secondo)
window.setTimeout("doRefresh();", 10000);
</SCRIPT>
</HEAD>
<BODY>
<p align="center">[img]http://www.parapendionline.com/images/<?php echo $arrayfile[0]; ?>[/img]</p>
</BODY>
</HTML>
</body>
</html>
Cioè ordina per ultima modifica.
In teoria quello che ho fatto funziona ma non l'ho provato.