I'd create a single PHP script that fetch text files and output them. So you don't have to create a new PHP file with "header('Access-Control-Allow-Origin: *');" everytime.
Also, if the application is hosted on the same server, none of this is necessary.