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 help with cin setw
I made a program here is my code:

#include
#include
#i

storing video files into mysql in php
hi

i have my video files in my folder ,
i have to store the path of the videos into db an

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.
The

Content-Disposition: attachment; filename=... not working as i thought it should
taken the following code from the php.net site the script is not working.

what is not happeni

regex for quoted text within a string
I am still getting the hang of regex expressions, but I cant seem to figure out how I would escape q

Match stored value with the current value in a loop
Hello,

I have a MySQL db were I store articles in.

I have a form to fill these article

mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???

this is the code i got

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

Multi dimensional arrays
If I put in this code:

1
2
3
4
5
6
7
8
9
10
11
12
13<

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