Pull all jpg's from a folder into a PHP array?
<p>I want to simply pull all the JPG files from a specific folder (on MY server) into an array. I figure it would look something like this. My logic here is that I'd have a folder with images I want in a gallery so I could just upload images with an FTP and they would just show up. Is this a good idea?</p>

<pre><code>$dir = 'www.example.com/folder1/';

$images_array = SOMEFUNCTION($dir);

foreach ($images_array) as $v){
echo '&lt;img src="'.$dir.$v.'" /&gt;";
}
</code></pre>

<p>Thanks for the help!</p>
