ftp_raw() function in PHP


The ftp_raw() function is used to sends raw command to the FTP server.

Syntax

ftp_raw(con, command)

Parameters

  • con − The FTP connection

  • command − The command to execute

Return

The ftp_raw() function returns the server's response as an array of strings.

Example

The following is an example −

<?php
   $ftp_server = "192.168.0.4";
   $con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
   ftp_raw($ftp_conn, "USER david");
   ftp_raw($ftp_conn, "PASS yourpassword");
   // close
   ftp_close($con);
?>

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 30-Jul-2019

32 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements