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!
You need to recursively call the searchFiles() method on line 45. Its argument must be the directory you've found.
A few thing to mention:
- you don't need to return $this->files in this case - you have it in your object, so you can always access it later.
- I'd prefer glob() to iterate through files/directories
There are 10 types of people in this world, those who understand binary and those who don't
VladSun wrote:You need to recursively call the searchFiles() method on line 45. Its argument must be the directory you've found.
A few thing to mention:
- you don't need to return $this->files in this case - you have it in your object, so you can always access it later.
- I'd prefer glob() to iterate through files/directories
Thank you so much for the reply. Yes, I know, but the result is something really odd; if you care to try it, hehe.
Yes, I will consider using glob(). I tried using it at first but ran into problems... Maybe a second approach will do. I'm concerned about speed and resources too.
feyd posted a very nice non-recursive directory tree function here that may be useful!
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.
One of the main problems was that you were setting $this->files in the loop, so if you also returned it and set it to a new array of $this->files recursively, then it would just keep growing.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
AbraCadaver wrote:One of the main problems was that you were setting $this->files in the loop, so if you also returned it and set it to a new array of $this->files recursively, then it would just keep growing.
Whoa! thank you, so much, for the help!
I'm new to OOP so I am prone to committing stupid mistakes. Thanks for the constructive critique