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

Linked Keywords
I am trying to get a script that makes my predefined keyword converted to links and / or converted t

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

Undefined offset
The following script checks to see if the user answer matches the correct answer.

Form Fiel

Product categories for registration
Dear all,

We are going live with the Supplier registered next week. At standard, the 'sel

How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to

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

bit of help needed
Im about to sort out my registration page for my website by customising a "registration" s

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

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