I want to print the list of files and only files from an FTP server, here is what I could accomplish.
<?php
$ftp_server = "my ftp server";
$conn_id = ftp_connect($ftp_server);
$ftp_user_name = "ftp username";
$ftp_user_pass = "ftp password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
$contents = ftp_nlist($conn_id, '/');
for ($i = 0 ; $i < count($contents) ; $i++)
echo "<li>" . substr($contents[$i],1) . "</li>";
ftp_close($conn_id);
?>
but this prints the names of files and folders. How can I just print the names of files (files may not have extensions!)