Hi;
Okay, say I have a bunch of pictures in directory/subdirectory "groups/photos/" with names like "group1_00.jpg", "group1_01.jpg", "group1_03.jpg", (and similar sets for group2, group3, etc.)
I understand how to get a filtered set of filenames from the target directory into an array via a command like this:
$groupID="group1"; //(a variable value passed from a form or link)
$filenames=glob("groups/photos/".$groupID."*.{jpg,JPG,jpeg,JPEG}", GLOB_BRACE);
The resulting array will contain values pre-pended with the directory/subdirectory string like this. "groups/photos/group1_00.jpg", "groups/photos/group1_01.jpg", "groups/photos/group1_03.jpg". I DON'T want that. I know I can strip the directory strings off after the fact with ltrim() but I was wondering if there is a way to do the initial request for the array into the specific subdirectory without returning that part of the string into the array.
ie. I want a command something like:
$filenames=glob("groups/photos/".$groupID."*.{jpg,JPG,jpeg,JPEG}", GLOB_BRACE);
to return:
$filenames=array("group1_00.jpg", "group1_01.jpg", "group1_03.jpg")