久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php 怎么刪除文件夾中的文件

      php刪除文件夾中的文件的方法:1、直接通過(guò)unlink函數(shù)刪除指定文件;2、創(chuàng)建一個(gè)delFileUnderDir方法,并在方法體內(nèi)使用while讀取文件夾,如果文件夾中存在文件,則使用unlink方法刪除文件即可。

      php 怎么刪除文件夾中的文件

      本文操作環(huán)境:Windows7系統(tǒng)、PHP7.1、Dell G3電腦。

      php文件刪除用unlink()函數(shù)

      首先創(chuàng)建了一個(gè)文件,名為testFile.txt 。

      刪除指定文件

      $filename = 'file.txt'; fopen($filename,'a+'); if(!unlink($filename)) { echo "文件{$filename}刪除失敗";  } else { echo "文件{$filename}刪除成功"; } ?>

      刪除目錄下所有文件

      function delFileUnderDir( $dirName="../Smarty/templates/templates_c" ) {  if ( $handle = opendir( "$dirName" ) ) {    while ( false !== ( $item = readdir( $handle ) ) ) {    if ( $item != "." && $item != ".." ) {    if ( is_dir( "$dirName/$item" ) ) {          delFileUnderDir( "$dirName/$item" );    } else {    if( unlink( "$dirName/$item" ) )echo "成功刪除文件: $dirName/$item<br />n";    }    }    }    closedir( $handle ); } }

      【推薦:PHP視頻教程】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)