ftp_ssl_connect() function in PHP

王林
Release: 2023-08-29 08:46:01
forward
1428 people have browsed it

ftp_ssl_connect() function in PHP

The ftp_ssl_connect() function opens a secure SSL-FTP connection.

Syntax

ftp_ssl_connect(host,port,timeout);
Copy after login

Parameters

  • host − FTP server address. It can be a domain name address or an IP address.

  • #port − The port to connect to. The default is 21.

  • timeout − Timeout period for network operations.

Return value

The ftp_ssl_connect() function returns the SSL-FTP stream on success, and returns FALSE on error.

Example

The following is an example −

<?php
   $ftp_server = "192.168.0.4";
   $ftp_user = "jacob";
   $ftp_pass = "tywg61gh";
   $ftp_conn = ftp_ssl_connect($ftp_server) or die("Could not connect to $ftp_server");
   $login = ftp_login($ftp_conn, $ftp_user, $ftp_pass);
   // close SSL connection
   ftp_close($ftp_conn);
?>
Copy after login

The above is the detailed content of ftp_ssl_connect() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!