PHP 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() လုပ်ဆောင်ချက်သည် သတ်မှတ်ထားသော host သို့ 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 စီးကြောင်းတစ်ခု သို့မဟုတ် မှားယွင်းနေပါသည်။ |
---|---|
PHP ဗားရှင်း- | 4+ |
PHP Changelog- | PHP 4.2.0 တွင် timeout parameter ကို ထည့်သွင်းခဲ့သည်။ |
❮ PHP FTP အကိုးအကား