PHP ftp_rawlist() လုပ်ဆောင်ချက်
ဥပမာ
ဖိုင်အချက်အလက်ပါရှိသော ဖိုင်များစာရင်းကို ရယူပါ-
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// get the file list for /
$filelist = ftp_rawlist($ftp_conn, "/");
// close connection
ftp_close($ftp_conn);
// output $filelist
var_dump($filelist);
?>
အထွက်သည် ဤကဲ့သို့သောပုံပေါက်နိုင်သည်-
array(3)
{
[0] => string(57) "drw-rw-rw- 1 user group 0 Jan 03 08:33 images"
[1] => string(62) "-rw-rw-rw- 1 user group 160 Feb 16 13:54 php"
[2] => string(75) "-rw-rw-rw- 1 user group 20 Feb 14 12:22 test"
}
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ftp_rawlist() လုပ်ဆောင်ချက်သည် ဖိုင်အချက်အလက်ပါသည့် ဖိုင်စာရင်း (FTP ဆာဗာရှိ သတ်မှတ်ထားသော လမ်းညွှန်မှ) ပြန်ပေးသည်။
အထားအသို
ftp_rawlist(ftp_conn, dir, recursive);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
dir | Required. Specifies the directory path. May include arguments for the LIST command. Tip: Use "." to specify the current directory |
recursive | Optional. By default, this function sends a "LIST" command to the server. However, if the recursive parameter is set to TRUE, it sends a "LIST -R" command |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဒြပ်စင်တစ်ခုစီသည် စာသားတစ်ကြောင်းနှင့် သက်ဆိုင်သည့် အခင်းအကျင်းတစ်ခု (ခွဲခြမ်းစိပ်ဖြာခြင်းမပြုပါ)။ ရှုံးနိမ့်မှုတွင် FALSE ကို ပြန်ပေးသည်။ |
---|---|
PHP ဗားရှင်း- | 4+ |
PHP Changelog- | PHP 4.3 တွင် recursive parameter ကို ထည့်သွင်းထားသည်။ |
❮ PHP FTP အကိုးအကား