I am in need of a PHP script. The script should be 1 file and should not take more than 1 day to complete by an expert php programmer.
What I have is a set of directories (Websites) that have files in them starting with numbers. Each file has an H1 tag in it explaining what the file is about. The script should read all those files in a certain specified directory, should then change the file name to what ever the H1 tag says, and should upgrade all the links in the file, which are pointing to a reference file that starts with a number. This should be done with all files in the directory and the end result would be a directory of filenames that are the same as the H1 in them, linking together as they were without breaking any links. Some files dont start with a number and dont need to be renamed, but their links need to be updated.
I would rather not change anything and make a new directory and dump in it all the new files with the new names and the changed links in them.
Please see the uploaded file for an example of how a website looks like.