My OS environment is linux.
I have a php file in this folder - /var/www/html (say... test.php)
I also have a folder called DATA_SOMENUMBERHERE in the same directory.
Inside test.php, I need to find out the SOMENUMBEREHERE.
In other words, find the folder whose name starts with DATA_ and get the remainder part of the string.
One way to do it is, get all folder names in that directory and loop through them and find out.
But is there another way? Can I pass some kind of regexp to some file system function call so that I get all folder names matching that pattern?
A single function call will be ideal. But if none are available, I am okay with looping through.
Safe Assumptions:
There will always be a folder that starts with DATA_
There will be only one folder that starts with DATA_
SOMENUMBERHERE will keep changing.