So currently I have two PHP files, they are identical. There is a function that updates the current file being used to add data and also a clear function. I want the clear function on the first file to replace itself with the content of the second.
You can use
__FILE__ to get the pathname of the current file, and overwrite this with the second file.