I am writting a PHP script to search for a directory, or at least I am trying too, but I haven't the slightest where to start, what commands to use and what sort of expressions to use. I want to be able to put a word into a form, and find the closest matches alphabetically. I know how to write a statment to return the exact dir that matches a word, but I want to be able to match similar dirs too. for example,

Lets say there are directories: home, files, jack, jim

Now lets say I enter the word john, it will return jack and jim in that order. if I put jack in, it will return jack jim in that order, if i put jim, it will return jim. if i but house, it will return home.

I think that sums up the jist of it. I am some what new at php, but learning fast. I can write the script i just have no idea what commandds and how to use them. any help on this would be great.

    Hey! I am hoping I can help you but can you give me and an example of a list of directories and what exactly you need to use this for.

    Like a list of directories like so:

    root
    /user
    --/ bob
    --/ joe
    --/ kevin

    I hope I can help...

      Ok, basically, I am writting a script and I keep things organizd by directory. I want to be able to type in a word, and i want it to return the most likely mactches. Directories will automatically be added all with different names. it could be any list of directories, it will not move up or down the dir structure. it will only be in the directory the script is in.
      the first match would be exact, next would be all the letters except one, or the next in alphabetical order. and so on and so fourth

      to match aaaa assuming all these directories exist.

      aaaa
      aaab
      aabb
      abbb

      or
      aaab
      aaac
      aacc.

      if i could get it to mactch from between the first to the first 4 letters that would be enough.

      or mabey if I could sort all the dir names in order starting with the one entered in the form. that would be the best way and maybe only to show 10 or 20 of them

      to me that seems like the easyest way. now I relize I should try to use readdir() to do this. I am going ot work on this, If you have ideas, or know a better way, let me know

      thanx

        Write a Reply...