I am currently using shell_exec to create/add data to about 5 different files. I'd like to get away from shell_exec and use fopen. I'm trying to be a better programmer so what is the best way to use fopen if I need to add data to 5 different files? Do I just simply open/close handle, open/close handle literally 5 times? Or should I create some kind of function for it?
I don't need to read the file.
If the file exists, write to it, if not, create it. If there's data, write over it. That's why I will be using "w".
$fp = fopen("/usr/local/apache/htdocs/dev01.txt","w") or die ("some message");
Here's what I am doing currently...
(don't worry about what it is that I'm doing, it's a LONG story)