在此之前,请先在window7上搭建apache-ftp服务器,请查看文章:Windows 上搭建Apache FtpServer

test.php

<?php 
set_time_limit(0);
$ftpServer='localhost';
if (!$ftp=ftp_connect($ftpServer,2121,30)) {
    die('Connection failed');
}
if (!ftp_login($ftp, 'admin', 'admin')) {
    die('Login failed');
}
echo "<pre>Files Available:\n";
$files=ftp_nlist($ftp, '/');
foreach ($files as $file) {
    echo $file."\n";
}
echo "</pre>";
 ?>

 

相关文章:

  • 2022-12-23
  • 2021-08-27
  • 2021-06-12
  • 2021-11-17
  • 2022-01-11
  • 2021-11-25
  • 2021-10-21
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-04-18
  • 2021-12-10
  • 2021-11-09
  • 2021-04-13
相关资源
相似解决方案