473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

File Names Into Array



right so im in the midst of creating a gallery for a friend of mine, i
have most of it right, but when i get the file names from the directory
and into an array i have the ".." and "..." as the first two elements,
any ideas?

my getImages functions is simply as follows:

#PHP

function getImages()
{
global $images;
$mydir = opendir(images);
for($i=0; $i<10; $i++)
{
$entryname = readdir($mydir);
$images[] = $entryname;
echo("<br>");

}
#PHP

Jul 17 '05 #1
1 2168
I noticed that Message-ID:
<11**********************@l41g2000cwc.googlegroups .com> from
bo********@gmail.com contained the following:
for($i=0; $i<10; $i++)
{
$entryname = readdir($mydir);
$images[] = $entryname;
echo("<br>");

Well I don't think that's the only problem with this function. The only
thing it appears to output is line breaks.

This snippet from one of my scripts might help.

if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(($file!="."&&$file!="..")){
echo "<tr><td>filename:&nbsp;</td><td><b> <a
href=\"$file\">$file</a></b></td><td>Type:&nbsp</td><td>". filetype($dir
.. $file)."</td><td align=\"center\"><input
type=\"checkbox\"name=\"delete[]\" value=\"$file\"><td></tr>\n";
}
}
closedir($dh);
}
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jonas | last post by:
I want the user to be able to write like http://www.google.com in one textBox and Google in an other textBox. Than I want the user to press a button when done. The text will then be past like...
2
by: gonzo | last post by:
So I have a project where I'm supposed to have a .txt input file of no more than ten first names, last names and birth years, and than in a menu I'm to give the user some options as to how the...
6
by: chris237 | last post by:
I'm having trouble with the following program. i want it to have the options to save a list of data entered by the user and display it the next time they run it. Could someone please either show me a...
8
by: OziRus | last post by:
Hi, I've char* array that I defined like char *str. I want to read from a file, that contains names in each row, and assign them to my str char * array. m is a char array, f is a file...
2
by: GeoUK | last post by:
Hi All, New member here with a bit of problem. I have read the FAQ's and searched text books but still cannot solve the problem that I have. As part of a course I am doing at University I had...
4
Ispep
by: Ispep | last post by:
Hi, unfortunately having a bit of difficulty with a question from an Open University course I'm currently doing. If you could help me out in any way I'd be grafeul (though obviously it goes without...
10
by: deciacco | last post by:
I'm writing a command line utility to move some files. I'm dealing with thousands of files and I was wondering if anyone had any suggestions. This is what I have currently: $arrayVirtualFile =...
1
by: shadowofanubis66 | last post by:
Basically, the project I'm working on this week is to make a school lunch menu with a GUI, when the person types in a day, the menu for that day shows up. We have two files, ones a day off text file...
0
by: Filemaxor | last post by:
I have gotten my code to be able to allow people to add new text to a .txt document and able to call up files so the user can see whats in it. The problem i'm having is getting the for loop to work...
3
rajiv07
by: rajiv07 | last post by:
Hi to all, I have a script to list the file names in a directory .When i run this script locally (command prompt) it displays the exact file name (even though the file name has two spaces).But i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.