ftp_raw ($ftp_connection, $command) Parameters:
this function takes two parameters as specified above and described below:
- $ftp_connection:Required. Indicates an existing FTP connection.
- $command:This parameter is required. Specifies the command to execute on the FTP server.
returns the server response as an array of strings. Returns raw data, no analysis is performed. This does not affect determining whether a command has completed or not.Notes :
- This function is available for PHP 4.0.0 and newer .
- The following examples cannot be run in the online IDE. So try running PHP on some hosting server or localhost with the correct ftp server name.
/ / Connect to FTP server
// Use correct FTP server
// Setting up ftp connection
= ftp_connect (
"Could not connect to $ftp_server"
// Save the response from ftp_raw() to $response
= ftp_raw (
// Print $response using print_r()
// Close the connection
Connection closed Successfully! "
Array ( = > 331 Password required for abc) Connection closed Successfully! Link: https://www.php.net/manual/en/function.ftp-raw.php