PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am needing to grab data from a database and create a file temporarlily for use with the exec() function. Is there any easy way to do this without actualy going through all of the steps of fopen() fwrite()... then deleting the file when i'm done.
Does such a function exists that I may be able to send some text to it and a filename and use it until the page changes and have it deleted?
you can make a function that does the filename and text things.. You'd need to set a handler for shutdown or some other events to handle the page ending.. (it's better to delete it when you are actually finished with it)
This is an opportunity to create a class that handles all this for you.
A temporary file may not be the best choice depending on what your doing. If you are just doing something like creating a specific saying on a certificate and then allowing a user to print it off or something like that where more than one user may access the page at once I would say use a database.
If not then I would say use feyd or marks suggestion.