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

Export hangs
Hi all, please help

I have a Oracle 10.2.0.3.0 database. When I want to query the dba_segmen

Problem with creating FI documents
Hi, Experts!

when i create Fi doc. with standart transaction, i ve been had such problem

php not working written for consumption of slots
1. Here is the function where i will be allowed to consume the slot booked by me.

2. Here i c

Undefined index on my form
ok im getting Undefined index on this line.. print_r($_REQUEST['form']);

below is the full sc

PayPal Redirect Issue
When I have my paypal button set so that is redirects to http://empiremarketing.ca/order.php,it work

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

Not capturing all the information we require in the form.......
Hi Guys,

I was wondering if you would share some more of your knowledge today, I'm hoping it

php forms and database navigatio
Hello,
I'm new to php and i'd like to post the following.
I have written code to get records f

Need help to identify this error please
:confused:Can anyone help me tell what this error message means? Maybe tell me where to look to fix

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