ftp_exec()
PHP ftp_exec() funksiyasi
Misol
FTP serverida buyruq bajarilishini so‘rang:
<?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);
$command = "ls-al > somefile.txt";
// execute command
if (ftp_exec($ftp_conn,$command))
{
echo "$command executed successfully.";
}
else
{
echo "Execution of $command failed.";
}
// close connection
ftp_close($ftp_conn);
?>
Ta’rif va qo‘llanilishi
ftp_exec() funksiyasi FTP serverida buyruq bajarilishini so‘raydi.
Sintaksis
ftp_exec(ftp_conn, command);
Parametr qiymatlari
| Parametr | Tavsif |
|---|---|
| ftp_conn | Majburiy. Ishlatiladigan FTP ulanishini belgilaydi |
| command | Majburiy. Bajariladigan buyruqni belgilaydi |
Texnik tafsilotlar
| Qaytariladigan qiymat: | Buyruq muvaffaqiyatli bajarilgan bo‘lsa TRUE; aks holda FALSE |
|---|---|
| PHP versiyasi: | 4.0.3+ |
❮ PHP FTP ma’lumotnomasi
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
