Wrong filename by image
<p>I have in my directory six images. He shows 2 images and 1 filename. The filename is wrong but he is in the directory but he shows not that image. Can you help me? I want that he show 2 images + 2 correct filename's.     </p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;?php
//path to directory to scan
$directory = "images1/";
//get all image files with a .jpg extension.
$images = glob($directory . "*.jpg");
shuffle($images);
?&gt;
&lt;html&gt;
&lt;meta http-equiv="refresh" content="60" &gt; 
&lt;head&gt;
&lt;title&gt;Image&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
&lt;?php
for($i=0;$i&lt;2;$i++)                                              
echo"&lt;img src=\"$images[$i]\"width=\"300\"height=\"400\"&gt;"; 
echo basename($images[$i], ".jpg");                                          
?&gt;  
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;     
</code></pre>
