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

What's best way to get a user's Word doc converted to simple html and images?
Hi all,

I was just wondering if anybody has any experience of this.
Basically, I'm buildin

need help in creating captcha
hi i have a problem creating captcha system. i create some basic script for image displaying but it

how do i make new line after *
First check this page here. and you see my report. Im pulling form a mysql db. I want to beable to m

private constructor
Hello,

Can we create a constructor as private? If yes, what is the use of it? If no, why can'

PDO returns erroneous columns from within pdt
Hi All,

This is a truly weird behavior:
When using a simple pdo fetch, erroneous columns a

URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But

values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a data

pagination numbering pattern
Hello,

I have following code which works great for pagination. but i have small issue now.

Exporting new records
Trying to figure out the best way to set this up.

People register my site.

Their prof

Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed

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