Note: you can use [php], [html] or [code] tags (as appropriate) to preserve formatting and (in some cases) get colorized code.
glob patterns don't offer a way of excluding files, but if the files you want to include , you might be able to use a more specific pattern (e.g. only the files you want end with '_f.jpg', so you use a pattern of '*_f.jpg'). You can filter out the entries using array_filter, preg_grep, or within your loop:
PHP Code:
<?php
// <= PHP 5.2
$files = array_filter(glob("*/*.jpg"),
create_function('$name', 'return ! preg_match("/_t[12]\.jpg$/", $name);'));
// >= PHP 5.3
$files = array_filter(glob("*/*.jpg"),
function($name) { return ! preg_match('/_t[12]\.jpg$/', $name);});
// or
$files = preg_grep('/_t[12]\.jpg$/', glob("*/*.jpg"), PREG_GREP_INVERT);
// or
foreach (glob("*/*.jpg") as $file) {
if (! preg_match('/_t[12]\.jpg$/', $file)) {
?>
<photo imageurl="<?php echo $file; ?>" linkurl="http://www.google.com">
<title>Image 1</title>
<description>This is a regular text description.</description>
</photo>
<?php
}
}
Another, simpler approach is to separate thumbnails from full images, storing each in separate directories. If you create a "thumbs" subfolder in each image folder, you wouldn't even have to change your glob pattern.