I have a directory with sitemaps that end in number.
I have an automatic Sitemap script generator that should count all Sitemaps in a folder using glob.
I'm currently stuck here.
I need to count all Sitemaps that have a number, so I don't count a number without any numbers.
For example, in my root I have sitemap.xml, then I also have sitemap1.xml, sitemap2.xml, sitemap3.xml, etc.
I need to use glob to return true only if the file name contains the number "sitemap1.xml".
Is it possible?
$nr_of_sitemaps = count(glob(Sitemaps which contains numbers in their filenames));
thank
user188962
source
share