note 103723 modified in function.ftp-rawlist by danbrown
| From: | danbrown@php.net | Date: | Fri, 29 Apr 2011 18:14:21 +0000 |
| Subject: | note 103723 modified in function.ftp-rawlist by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179287@lists.php.net to get a copy of this message | ||
One thing about the UNIX/Windows difference is that Windows will always start by listing the date,
which is a number.
You can simply use that fact for parsing:
<?php
// Function to parse ftp_rawlist (UNIX and Windows)
$list=ftp_rawlist($conn_id,"");
for($i=0;$i<sizeof($list);$i++){
if($list[$i][0]>='0' && $list[$i][0]<='9'){
// Windows first gives the date
// ...
}else{
// UNIX
// ...
}
}
?>
--was--
One thing about the UNIX/Windows difference is that Windows will always start by listing the date,
which is a number.
You can simply use that fact for parsing:
// Function to parse ftp_rawlist (UNIX and Windows)
$list=ftp_rawlist($conn_id,"");
for($i=0;$i<sizeof($list);$i++){
if($list[$i][0]>='0' && $list[$i][0]<='9'){
// Windows first gives the date
...
}else{
// UNIX
...
}
}
http://php.net/manual/en/function.ftp-rawlist.php