note 37075 deleted from function.ftp-rawlist by crell
| From: | crell@php.net | Date: | Thu, 31 Mar 2022 19:17:44 +0000 |
| Subject: | note 37075 deleted from function.ftp-rawlist by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217897@lists.php.net to get a copy of this message | ||
Note Submitter: moonglobe3739 [ A t ] hotmail .com
----
hope this helps someone:
<?php
$list = ftp_rawlist($ftp_stream,$dir);
$dirc = array();
foreach ($list as $file)
{
list($perms,$owner,$group,$size,$mtime,$fname) =
preg_match('#^([bcdlsp-][rwxtTsS-]{9})\s+(?:[0-9]+)\s+'.
'([a-zA-Z]+)\s+([a-zA-Z]+)\s+([0-9]+)\s+'.
'([A-Z][a-z]+ [0-9]{1,2} [0-9]{4} [0-9]{2}:[0-9]{2}) (.*)$#',$file);
$dirc[$fname]['permissions'] = $perms;
$dirc[$fname]['owner'] = $owner;
$dirc[$fname]['group'] = $group;
$dirc[$fname]['size'] = $size;
$dirc[$fname]['modtime'] = $mtime;
}
?>