W3Schools.com

PHP ftp_raw() Function


PHP FTP Reference Complete PHP FTP Reference

Definition and Usage

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

Syntax

ftp_raw(ftp_connection,command)

Parameter Description
ftp_connection Required. Specifies the FTP connection to use
command Required. Specifies the command to execute


Tips and Notes

Note: This function returns the server response as an array of strings. No parsing is performed, and ftp_raw() does not check if the command was correct.


Example

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");

print_r (ftp_raw($conn,"USER admin"));
print_r (ftp_raw($conn,"PASS ert456"));

ftp_close($conn);
?>

The output of the code above will be:

Array ([0] => 331 User admin, password please)
Array ([0] => 230 Password Ok, User logged in)


PHP FTP Reference Complete PHP FTP Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE