开发者

Echo all directory with php ftp function starting with

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜