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 understanding of this bit of code
Code: <?php
// WHERE clause filters
$arrSQLFilters = array();

//

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

MYSQL gen help
This is my Mysql gen. can anyone tell me why this echos

MID(networkset.networkid, 3, 3) AS &q

I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bun

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

Socket programming
Hello all,

I have a PHP socket script. GPS trackers connect to this socket. IMEI verification

PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is

PHP Directory Listing Not working
Hey Guys,

I need help, I tried a ton of directory listing scripts and they all don't work. Al

Connection Timeout
I'm using xmii 12.0

I'm calling a transaction as a web service from a windows application

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

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