You can split the numbers into different glob arrays and combine them.
For example, first you take all the images from 0-9 into one array:
$g1 = glob('thumbname-[0-9].jpg');
After that, you create another array that contains numbers from 10 to 99:
$g2 = glob('thumbname-[0-9][0-9].jpg');
Now you combine these 2 arrays into one and get everything from 0 to99:
$gResult = array_merge($g1, $g2);
You can expand it as much as you want, just add [0-9]
utdev source share