1
Hello, I need your help, I am making a very complex system (for a change) that in one of the parts of this system, has to enter a folder, however, this folder will have an undefined name, the system will have to find what was not defined, in simplification: My system needs to go through in a folder, even not knowing its name, since most of the functions I use, need the folder name, well and for those who find it easy this, know that in this system, it will only use functions that do not connect to a database. Now I will give you examples of this:
fopen("vaidarerrado/(PASTA NÃO DEFINIDA)/index.php","r");
If you observe, the function "fopen" will go through the folder "vanity" all right, until when it arrives at something undefined that in this case I marked as: "(FOLDER NOT DEFINED)", which in this case obviously gives a huge error, because as a function can go through a folder, that not even the programmer informed?, (alias the system wants to pass the "(FOLDER NOT DEFINED)" because it aims to access the file "index.php" even without knowing which folder it is in) ,in another simplification: go through a folder without knowing the name to find a specific file, and the only function I know, that takes SOME information from an undetermined folder, and the function:
glob();
EXAMPLE:
count(glob("vaidarerrado/{*}",GLOB_BRACE));
the code "glob" above, even without knowing the name of the folder, can "know of its existence" and give the number of things that have in the directory "vain", of course, this was just an example, what I want, and go through a folder without knowing its name, to find a file, or if you can, enter the name of the folder. I hope you help me or get to the "Index.php" GOING THROUGH THE UNDEFINED FOLDER or somehow, getting the name of the folder, good luck to you, I expect some answer ;p (kk)
Why don’t you use the function
glob
if she does what you need?– Woss
the answer is in the question itself... normally the glob() or equivalent is used.
– Daniel Omine