Php script to replace specific string in filenames from database
<p>I need a simple php script which needs to find files on server after reading Number column from database, copy files to another directory and then replace specific strings in saved files. For example we have files</p>

<p>20160107-151620_03216488727-all.mp3
<br>20160418-105509_03225545395-all.mp3</p>

<p>We need to replace (03216488727, 03225545395) with the strings from database. Here is my database info:</p>

<p><br>Number      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Policy Number &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Month
<br>03216488727 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;123456788 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2016-06
<br>03225545395 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;123433339 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2016-06</p>

<p>so after the replacement files will be</p>

<p>20160107-151620_123456788-all.mp3 
<br>20160418-105509_123433339-all.mp3</p>

<p>Please help.</p>