Thanks Richard, that works.
I have not spent much time refining this but opens up lots of possibilities. Your code works great. I have added a slight modification to delete any php files first before the rename procedure happens which lets me continue to update the export folder with the new renamed php files.
Just a side question. Do you know of any method that would automate a task to open a html file after export and run a jquery task and then save the resulting html as a new file?
As a example I have a regular block of code that is displayed while designing, however it is switched out with a jquery task to hide that block of code and then unhide another that is in a custom html block that contains php code for a cms I am using.
Rather than complete this task on page load in the browser, I would like to upload the already edited html file that has had the jquery task already run which would remove the code (by id's) instead of hiding.
Is this something possible ?