Jump to content

Archived

This topic is now archived and is closed to further replies.

GRPsuper

Deleting Text in a File

Recommended Posts

what is the code i would need if i wanted to delete all text in a php file with a chmod set to 7,7,7,7?

Share this post


Link to post
Share on other sites
Use fopen to open the file then fwrite that'll erase al data in the file.

Share this post


Link to post
Share on other sites
Follow what wildteen stated, but make sure your fopen mode is set to either "w" or "w+". Alternatively, you can also use file_put_contents if you are using PHP 5+ or you could also use unlink which will remove the file and then you can recreate it at your will. As you can see there are several possibilities. I suggest checking out www.php.net/filesystem

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.