PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
scottayy wrote:Are you saying that it shouldn't follow . and .. if my coding tells it to? Because before I added the check to skip those directories, it definitely followed them and not only sent me into a very long loop
You will find . and .. in every directory
. references the current directory while .. points to the parent directory.
Therefore if you let the function call itself with '.' as parameter you will get an infinite loop
Yes, I realized that was my problem last night. I've done a directory reader lots of times and for some silly reason I forgot that last night. The script began "working" after I excluded those from being evaluated.
However it didn't really "work" because of is_dir() returning false (when in fact it is true). So now I have to halt development for a bit until I feel like developing remotely.
I could use the absolute path (which the user comments for is_dir reports is the solution to the bug), but then I'd have to count the levels and stack the directories to give a recursive absolute path (probably should do this anyways but I'm being lazy at the moment).
Thanks for your insight!
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.