line breaks in between fetched file names


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($file = readdir($dir) )!== false){
if ($file !='.' && $file !='..'){
echo '<a href="' . $file . '">' . $file . '</a>';"n";

}
}
closedir($dir);
}
?>
but when it outputs the files from the files folder, it lists them one after another with no spaces etc. How can I make it list one file per line?

e.g.
file_1.doc
file_2.png
file_3.exe

Thanks

No comments posted yet

Your Answer:

Login to answer
176 Like 40 Dislike
Previous forums Next forums
Other forums

Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag

A problem with my GD class
Hello,

I created a nice (and simple for now) GD class.
The problem is , it works great on

sapgui f4 help last search
I know this has to be simople. One user (maybe more) does not have the "last search saved" from the

PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?

im using ftp_put and it returns fa

Best PHP Documentation generator
Hello guys!

I would like to hear from you what is the best PHP documentation generator. Perso

multiple recipients + dbuser mail recall
Hello,

I am building a php login script.

When the user registers the script will send

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Remove letter from numeric textbox
I have a textbox that will search the employee database by entering in the employee ID and it will r

Calculating n! using vector
#include
#include
#include

using

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash