Reputation: 3938
I am using PHP to access some folders with a specific path starting with the letter: "C". Can I somehow use a wild character in order to get all the folders names starting with C?
For example I have three folders as: Camera, Center, Calls The sub directories of these paths are the same. How can I do something like this in PHP:
$var = "C*/folder_1/folder2/"
Upvotes: 0
Views: 452
Reputation: 5899
You're looking for the glob()
function.
var_dump(glob('C*/folder_1/folder2/'));
Upvotes: 1