开发者

Echo all directory with php ftp function starting with

开发者 https://www.devze.com 2023-03-07 02:48 出处:网络
Is there an way in php to use the ftp function te echo all directory starting with \'20110508\'? So it wil list:

Is there an way in php to use the ftp function te echo all directory starting with '20110508'?

So it wil list: '20110508 abcde' '20110508 fghi' '20110508 jklm'开发者_如何学Go etc.


you can use ftp_nlist function to retrieve file list of specified diretory, then fetch through this array and filter items by comparing with desired mask e.g.

$contents = ftp_nlist($conn_id, ".");
foreach($contents as $f)
  if (substr($f, 0, 8)=='20110508') {
    echo $f;
  }
0

精彩评论

暂无评论...
验证码 换一张
取 消