line breaks in between fetched file names


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

Hi,

I have this code:
Code: <?php
Did you know?Explore Trending and Topic pages for more stories like this.
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

need Array help
This is what I have to do.
$teamname[1] = "Red Sox"
$teamname[2] = "Gian

Validating time
Hi Guys

what do you think of the following approach to validate a 24hour time:

http://

Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...

The coeffi

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

Help with simple query
Hi,

I'm trying to do a Query with a Union where I want to print the number of rows $tc conta

Move array index to end
Hey guys,
Quick question:

I have an array that looks like this:
Code: [Select]$var =

How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.

I'm using gamecanvas and I was thinking t

Display certain image depending on time of year
Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have don

COde for a Cc
I'm not receiving $ft as a Cc. Why is that??

$to = "$email";
$headers = "Fr

Why Are These Functions Causing MASSIVE Memory Problems? Please Help!
Hi,

I have a script with some options.

I use regex to replace patterns in strings, but

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