- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ftp_rawlist() function in PHP
The ftp_rawlist() function displays the list of files with file information from a specified directory
Syntax
ftp_rawlist(conn,dir,recursive);
Parameters
conn − The FTP connection
dir − The directory path
recursive − Sends a "LIST" command to the server by default.
Return
The ftp_rawlist() function returns an array where each element corresponds to one line of text.
Example
The following is an example to get a list of files with file information −
<?php $ftp_server = "192.168.0.4"; $ftp_user = "jacob"; $ftp_pass = "tywg61gh"; $con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server"); $login = ftp_login($con, $ftp_user, $ftp_pass); $file_list = ftp_rawlist($ftp_conn, "/"); // close connection ftp_close($conn); var_dump($file_list); ?>
Advertisements