Home >Backend Development >PHP Problem >How to delete yourself in php
How to delete yourself in php: First create a PHP sample file; then delete yourself through the [if (file_exists($file)) {@unlink ($file); }] method.
Recommended: "PHP Video Tutorial"
In fact, asp and php delete their own code
z.asp
The code is as follows:
<% s= Server.MapPath("z.asp") Set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists(s) Then fso.Deletefile(s) End If Set fso = Nothing %>
z.php
The code is as follows:
<?php $file = "z.php"; if (file_exists($file)) { @unlink ($file); } ?>
Run it and it will disappear....
The code is as follows:
<% s2= Server.MapPath("z2.asp") s= Server.MapPath("z.asp") Set fso = CreateObject("Scripting.FileSystemObject") fso.CopyFile s2,s Set fso = Nothing %>
The above is the detailed content of How to delete yourself in php. For more information, please follow other related articles on the PHP Chinese website!