You could do something like:
<?php
foreach(range(1, 1000) as $nbr) {
if(file_exists("images/image$nbr.jpg"))
{
echo "<a href='images/image$nbr.jpg'>image$nbr</a><br />\n";
}
}
It might be more efficient to do something like:
<?php
$images = glob("images/image{0,1,2,3,4,5,6,7,8,9}*.jpg", GLOB_BRACE);
foreach($images as $file)
{
echo "<a href='file'>".basename($file)."</a><br />\n";
}
(This approach though would assume that there will not be file names in that directory such as "image12abc.jpg" that you do not want to be included in the list.)