PHP Move Files With Specific Format vs Move All Files
<p>I have these files in /public_html/ directory :</p>

<pre><code>0832.php
1481.php
2853.php
3471.php
index.php
</code></pre>

<p>and I want to move all those <strong>XXXX.php</strong> (always in 4 digits format) to directory /tmp/, except index.php. how to do it with reg-ex and loop?</p>

<p>Alternatively, how about moving all files (including index.php) first to /tmp/ then later on put only index.php back to /public_html/, which one you think is less CPU consuming?</p>

<p>Last thing, I found this tutorial to move file using PHP: <a href="http://www.kavoir.com/2009/04/php-copying-renaming-and-moving-a-file.html" rel="nofollow">http://www.kavoir.com/2009/04/php-copying-renaming-and-moving-a-file.html</a> </p>

<p>But how to move ALL files in a directory?</p>
