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

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Staff Induction System - No idea where to go from here!!!
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

calculator
I can't figure out why this code doesn't work. No error messages. Page loads.

Code: <

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

how to export excel file in same server
My first post - php newbie, so appreciate your support.

I'm currently using headers to save w

how to populate a drop down box
Hi buddies!

PROCEDURE DOWNLOAD_REPORT_FORM (report_name varchar) is begin DOWNLO

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Php - mysql select?
hi, i have this code:

Code: <?php
session_start();
// dBase file
include &quo

how do i make a string??
hey guys,
can someone please tell me how to put data from the glob function into a string

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

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