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

quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...

I often see an exa

SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign

drop-down with sub-category appear
Hello,

i know how to build a simple dro-down list, im looking for a code when im gonna choose

PHP MySQL and DATE
Hi everyone

I have a databse and in one of the columns I have date values such as 2009-March-

button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdo

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

multiple recipients + dbuser mail recall
Hello,

I am building a php login script.

When the user registers the script will send

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw

PHP MySQL Return Results Issue
Hi guys,

I'm running joomla and made a module which is using ajax.
Basically i just have a

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