\n";
echo "\n";
// create directory object and set up a counter for the array that will hold the filenames
$mydir = dir('/home/sites/webvictim/destguides/xml');
$j=0;
$file_array=array();
// while there are files still in the directory
while(($file = $mydir->read()) !== false)
{
// if the extension is .xml
if(substr($file,(strpos($file,".")))==".xml")
{
// add the file into the array (minus its .xml extension)
$file = substr($file, 0, strlen($file)-4);
$file_array[$j] = "$file \n";
}
$j++;
}
// close the directory
$mydir->close();
// sort and print the list of destinations
asort($file_array);
foreach ($file_array as $filename)
{
echo $filename;
}
echo " \n";
echo " | \n";
echo "\n";
echo "