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

understanding functions and classes
Code: [Select]
class person {
var $name = "Jimmy Goe";

function get_nam

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then sudde

need help in update query
hi
i have a dynamic form. i need help in how can i use update query when values from dynamic for

Extract text from string
Hi folks,

I have a string that looks like this:

aaaaaaaaaa:
bbbbbbbbbb (ccccccccc)

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

Interpret Order
Hello all,

I'm wondering if I have this:

Code: $switch = array(
'one' =>

Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato

problem with php server update from mid 2009
Hi,

I have this navigation menu on 2 websites which used to work just fine. After a recent up

Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto

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