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!
I want to search the files in the folders in any depth by breadth first search and have written the following code but the code dose not seems like searching breadth first but it still is searching the files.
Here i assume that the function searches for the file or folder in the first level inside the root directory I have given then if it finds the file then returns the file and if it finds the folder I search, then it searches file inside the found folder in another level (in its descendants). and if it dose not find the any file and folder i want then it returns in the first level. Once it finishes search in the first level then it searches in the lower level descendants in the folders in the first level for the file and folder i want.
Hope this clarify you what I want. If any confusion then please ask.
Here I did not want to search any of the folders twice.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
If you want to search a file in any folder then the following code will be very helpful
test.php
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by devendra-m on Tue Jan 01, 2008 11:11 pm, edited 5 times in total.