line breaks in between fetched file names


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I have this code:
Code: <?php
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

christian louboutin sko til salg","prefixWrap":0,"src":"christian louboutin boots for sale","relation":[],"result":""},{
[b][url=http://www.spyder3.com/da/]christian louboutin sko til salg","prefixWrap":0,"src":"christian

Longines ure
[b][url=http://www.nicemenswatches.org/da/]bedste schweiziske replika ure[/url][/b] [b][url=http://w

Echo multiple lines of html code
Hi guys,

I would like to know if there is a way to echo multiple lines of html codes.

Tiffany Armbanden _ 2014 Goedkope Tiffany Armbanden UK Sale
[b][url=http://www.tiffanyandcouk.cn/nl/]tiffany sieraden[/url][/b] [b][url=http://www.tiffanyandcou

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Google+ Indyaspeak @ Pinterest RSS