• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot get the files from a directory in php

 
Ranch Hand
Posts: 83
Android Python Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to understand how all the different shopping sites might go about creating an entry of an item. I used the following code.

if you were to run this file, you would see that the only thing that shows up is a ".".
the code is also live on my website. the url to the files is  here. go ahead and download them if you want or use the url to read the files on your own pc. but the content of the first file is and the image is down below. thanks for all your help and i hope I can fix this problem.
001.jpg
[Thumbnail for 001.jpg]
the image mentioned in the txt file
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On Linux systems, each directory contains entry . which is the directory itself. Each non-root directory also has entry .. which is the parent directory. You'll need to go through the list of files and filter out these two entries. Right now you only print the first entry, which often is the . one.
 
Rocky Rocha
Ranch Hand
Posts: 83
Android Python Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes sense, thank you for your help! I remember seeing that, but I didn't know that it would affect getting a list of files from a directory.
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic