php test ftp connection script is as follows:
<?php $host = "xxx.xxx.xxx.xxx"; $user = "username"; $pwd = "password"; $port = "21"; $conn = @ftp_connect($host, $port) ; if($conn == false) { echo "conn fail!"; } else { echo "conn success!"; } $login = @ftp_login($conn, $user, $pwd); if(empty($login)) { echo "login fail!"; } else { echo "login success!"; } ?>
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the PHP test ftp connection, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.