Rumah >pembangunan bahagian belakang >tutorial php >技巧分享 PHP删除复制文件_PHP教程
即可.
PHP删除复制文件中的复制文件同样也很容易:
<ol class="dp-xml"> <li class="alt"><span class="tag"> ?PHP </span></li> <li> <span>$</span><span class="attribute">file</span><span> = </span><span class="attribute-value">'yang.txt'</span><span>; </span> </li> <li class="alt"> <span>$</span><span class="attribute">newfile</span><span> = </span><span class="attribute-value">'ji.txt'</span><span>; # <br>这个文件父文件夹必须能写 </span> </li> <li><span>if (file_exists($file) == false) { </span></li> <li class="alt"><span>die ('小样没上线,无法复制'); </span></li> <li><span>} </span></li> <li class="alt"> <span>$</span><span class="attribute">result</span><span> = </span><span class="attribute-value">copy</span><span>($file, $newfile); </span> </li> <li> <span>if ($</span><span class="attribute">result</span><span> == false) { </span> </li> <li class="alt"><span>echo '复制记忆ok'; </span></li> <li><span>} </span></li> <li class="alt"> <span class="tag">?></span><span> </span> </li> </ol>
以上就是PHP删除复制文件的相关技巧总结。