How do you itterate files in a directory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tony@tony.com

    #1

    How do you itterate files in a directory


    I'm using PHP to develop for a web site but I'd also like to use it
    locally on my Windows platform for easy conversion later on.

    I have PHP working fine on windows but now I want to do something
    thats stumped me.

    On windows-98

    I'm trying to perform operations on every text (*.txt) file in a
    directory but can't work out how to select them.

    Normally I use Delphi and findfirst/findnext etc.

    I looked for the equivalent PHP functions and did find directoryIterat e
    but there's no documents or much explanation at all and I can't get it to
    work.

    Am I doing the right thing or is there a better way - can anyone show me
    please ?

    thanks

    tony


  • fletch

    #2
    Re: How do you itterate files in a directory

    > I looked for the equivalent PHP functions and did find directoryIterat e[color=blue]
    > but there's no documents or much explanation at all and I can't get it to
    > work.[/color]

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    Comment

    • tony@tony.com

      #3
      Re: How do you itterate files in a directory

      In article <1145870513.725 035.57890@e56g2 000cwe.googlegr oups.com>,
      richard.a.fletc her@googlemail. com says...[color=blue][color=green]
      > > I looked for the equivalent PHP functions and did find directoryIterat e
      > > but there's no documents or much explanation at all and I can't get it to
      > > work.[/color]
      >
      > http://us2.php.net/manual/en/class.dir.php
      >
      >[/color]

      aha - thank you fletch. That will do it.
      I was misled by my own search string obviously.

      tony

      Comment

      • Mladen Gogala

        #4
        Re: How do you itterate files in a directory

        On Mon, 24 Apr 2006 09:20:20 +0000, tony wrote:
        [color=blue]
        > Am I doing the right thing or is there a better way - can anyone show me
        > please ?[/color]

        Look at the glob function.

        --
        大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


        Comment

        Working...