पीएचपी ftp_connect () फंक्शन
उदाहरण
एक FTP कनेक्शन कनेक्ट करें, लॉगिन करें और बंद करें:
<?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);
// then do something...
// close connection
ftp_close($ftp_conn);
?>
परिभाषा और उपयोग
Ftp_connect() फ़ंक्शन निर्दिष्ट होस्ट के लिए एक FTP कनेक्शन खोलता है।
जब कनेक्शन खुला होता है, तो आप सर्वर के विरुद्ध FTP फ़ंक्शन चला सकते हैं।
वाक्य - विन्यास
ftp_connect(host, port, timeout);
पैरामीटर मान
Parameter | Description |
---|---|
host | Required. Specifies the FTP server to connect to. Can be a domain address or an IP address. This parameter should not be prefixed with "ftp://" or have any trailing slashes |
port | Optional. Specifies the port of the FTP server. Default is port 21 |
timeout | Optional. Specifies the timeout for all subsequent network operations. Default is 90 seconds |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफल होने पर FTP स्ट्रीम या त्रुटि पर FALSE |
---|---|
पीएचपी संस्करण: | 4+ |
पीएचपी चेंजलॉग: | टाइमआउट पैरामीटर PHP 4.2.0 . में जोड़ा गया था |
पीएचपी एफ़टीपी संदर्भ