php 獲取目錄下檔案 批量改名 批量插入資料庫

2021-05-28 04:52:29 字數 656 閱讀 1460

今天要建立乙個足球隊伍的字典,上百條呀,手動忒麻煩,做了個小工具,實現將某個資料夾下的所有檔案重新命名,並且自動生成字典檔案。同時可以插入資料庫。

**如下:

<?php

require_once 'common/db_connect.class.php';

//利用php目錄和檔案函式遍歷使用者給出目錄的所有的檔案和資料夾,修改檔名稱

function frename($dirname)不是乙個有效的目錄!";

exit();

} $handle = opendir($dirname);

$count = 1;

while(($fn = readdir($handle))!==false)

else

} }}// 字典生成函式

function createzd ($team, $id)

function insertintodb ($team, $id)

//給出乙個目錄名稱呼叫函式

frename('e:\eoe');

?>

Perl獲取目錄下檔案或者包含子目錄下檔案

1 my dir d my work temp 2my files 34 獲取給定目錄下檔案 5 files get dir files dir 67 獲取給定目錄以及子目錄下檔案 8 files get dir files x dir 9 10 獲取目錄下以及子目錄下檔案,返回的結果中包含路徑 1...

Delphi 獲取指定目錄下檔案的大小

這個函式可以獲得指定目錄下所有的檔案路徑 名稱,能夠遞迴搜尋 procedure findallfile const dir string list tstringlist var hfindfile thandle findfiledata win32 find data fullname,fna...

sftp獲取服務端目錄下檔案列表

在ftp命令中,獲取遠端服務端的檔案列表直接通過ls命令即可將伺服器中檔案列表存入本地 ls remote dir local file 顯示遠端目錄remote dir,並存入本地檔案local file 在sftp中就沒有命令可用,只能自己想辦法。具體命令如下 expect data1 tmp ...