php - use glob() function to find files starting with variableGet the solution ↓↓↓
I am a bit of newbie to coding. I am looking to count the number of files in my directory that start with a string variable.
I don't know how to format a glob condition yet. I did some research but i am still lost.
I want my string
$files = glob($directory . "-$TaxonID*.jpg"); to search through the files and count how many begin with the variable TaxonID. But I don't know how to format such a condition. I am using a PHP query here.
Any help appreciated
Apologies for bothering you
I have figured it out
$files = glob($directory . "$TaxonID*.jpg"); it seemed to work very well. as in the first part of the file must equal taxonID then it can be whatever (asterix) but it must end in .jpg thank you for your help guys, just had to do more research myself
Share solution ↓
Link To Answer People are also looking for solutions of the problem: git was not found in your path, skipping source download
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.