There may be a better way, but if you do sort the filename and the extension into two different arrays, use the multisort to sort them so that the name and ext stay matched.
ie
$filename = array(filenames entered);
$extenstions = array(extenstions entered);
array_multisort($extenstions, SORT_ASC, SORT_REGULAR, $filename, SORT_ASC, SORT_REGULAR);
then use a foreach or for loop to extract the filname and extenstion together
echo'
<ul>
';
for($i=0, $i < count($filename); $i++){
echo'
<li>' . $filename['' . $i . ''] . '.' . $extenstion['' . $i . ''] . '</li>
';
}
</ul>