简体   繁体   中英

php command to delete the file after running

I have to run an installer written in php code that has to be deleted after it is run. It is a run-once setup process that for security reasons needs to be removed so it cannot be run again. The final lines of code display that the routine successfully completed then exits. Is there a way to script in for he file to "self destruct" after displaying that message?

It has never failed a successful run so I am not very worried about having to add another copy of it if that should ever happen.

all you need do is add

unlink(__FILE__); 

to the end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM