I am currently using SimpleXML to reading an xml file to generate my first array. This array displays a list of images that are found in a directory and written to xml file.This has worked for me in the past until I upload new photos to the same album. I like to know what one does to get a complete list of images that got uploaded to the end of that first array. Any suggestions?XML File:\[code\]<album><image path="/albums/1/images/100_4124.jpg" /><image path="/albums/1/images/100_4307.jpg" /><image path="/albums/1/images/100_4335.jpg" /></album>\[/code\]SimpleXML to get array:\[code\]$xml = simplexml_load_file('/albums/1/photos.xml');foreach ($xml->image as $image) { echo '<li><img src="'.$image.'"></li>';}\[/code\]What I am getting for my results:\[code\]<li><img src="http://stackoverflow.com/albums/1/images/100_4124.jpg"></li><li><img src="http://stackoverflow.com/albums/1/images/100_4307.jpg"></li><li><img src="http://stackoverflow.com/albums/1/images/100_4335.jpg"></li>\[/code\]Scanning the directory for all images:\[code\]if ($handle = @opendir('/albums/1/')) { $filenames = array(); while (false !== ($file = readdir($handle))) { $ext = substr($file, strrpos($file, '.') + 1); if ($file != '.' && $file != '..') { $filenames[] = $file; $total++; } }}closedir($handle);foreach ($filenames as $filename) { echo '<li><img src="'.$filename.'"></li>';}\[/code\]What I would like to get for results using both arrays:\[code\]<li><img src="http://stackoverflow.com/albums/1/images/100_4124.jpg"></li><li><img src="http://stackoverflow.com/albums/1/images/100_4307.jpg"></li><li><img src="http://stackoverflow.com/albums/1/images/100_4335.jpg"></li> <li><img src="http://stackoverflow.com/albums/1/images/100_9000.jpg"></li><li><img src="http://stackoverflow.com/albums/1/images/100_9001.jpg"></li><li><img src="http://stackoverflow.com/albums/1/images/100_9002.jpg"></li>\[/code\]The last 3 images that are missing from xml file would be added it to the end of the list.