पीएचपी 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_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 लौटाता है |
---|---|
पीएचपी संस्करण: | 4+ |
पीएचपी चेंजलॉग: | पुनरावर्ती पैरामीटर PHP 4.3 . में जोड़ा गया था |
पीएचपी एफ़टीपी संदर्भ