php “glob” pattern help

floresseoul

New Member
I have a directory with sitemaps, which all end with a number.I have an automatic sitemap generator script which needs to count all sitemaps in a folder using glob.Currently I am stuck here.What I need is to count all sitemap files which has a number in them, so I don't count the ones without any numbers.For instance, in my root I have a sitemap.xml file, then I also have sitemap1.xml, sitemap2.xml, sitemap3.xml etc...I need to use glob to only return true when the filename contains a number like "sitemap1.xml".Is this possible?\[code\]$nr_of_sitemaps = count(glob(Sitemaps which contains numbers in their filenames)); \[/code\]Thanks
 
Back
Top