创建一堆php/html文件的捷径


Short way of creating bunch of php/html files?

我正在尝试创建一个网站。这个网站会有这么多的gif/pics,所以我必须创建php/html文件来显示gif/pic。所以我只需要创建这么多php.html文件,否则就没有什么捷径了。

例如,我创建了gif.html和gif1.html,gif10000.html,花了很多次时间。我想也许还有一条捷径?

传递要在GET参数中显示的元素,例如:

show_picture.php?file=gif10000.gif

并且在CCD_ 2中通过CCD_。

以下是完整的PHP:

<?php
$allowedImages = array(
    'gif10000.gif',
    'gif2.gif' //etc
);
$file = $_GET['file'];
if (in_array($file, $allowedImages)) { 
    echo '<img src="'.$file.'" />';
}
?>