|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-14 21:17 UTC] carsten_sttgt at gmx dot de
[2009-05-14 21:48 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 21:00:01 2025 UTC |
Description: ------------ hello ftp_nlist($connect, $directory) if $directory contains '+' nothing is returned Reproduce code: --------------- function ftpList ($hostname, $username, $password, $directory) { $connect = ftp_connect($hostname); $autorize = ftp_login($connect, $username, $password); $buff = ftp_nlist($connect, $directory); foreach ($buff as $element) { $size = ftp_size($connect, $element); if ($size < 0) { $type = "dir"; } else { $type = "file"; } $return[] = array("name" => $element, "size" => $size, "type" => $type); } sort($return); return $return; ftp_close($connect); } Expected result: ---------------- array with ftp names and sizes sorted by alphabet Actual result: -------------- nothing