directory if (ftp_is_dir($v)) { //output as [ directory ] echo "[ " . $v . " ]
\n"; } } foreach ($ftp_nlist as $v) { //2. ftp_is_dir() is false => file if (!ftp_is_dir($v)) { //output as file echo "" . $v . "
\n"; } } ?>