digli il path corretto all' inizio, e tutto rimarrà coerente

Codice PHP:
<?
$xml 
'<?xml version="1.0"?'.'>';
$handle opendir("./IMMAGINI");
while ( (
$file=readdir($handle)) !== false ) {
    if ( !
is_dir($file) ){
        
$pic = @getimagesize($file);
        if(
$pic != false && $pic[2] == 2){
            
$xml .= '[img]'.$file.'[/img]';
        }
    }
}
echo 
$xml;
?>