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;
}
精彩评论