function _textimage_image_list in Textimage 5.2
Same name and namespace in other branches
- 5 textimage.module \_textimage_image_list()
- 6.2 textimage_admin.inc \_textimage_image_list()
- 7.2 textimage.admin.inc \_textimage_image_list()
Returns an array of files with jpg, png, and gif extensions in the specified directory.
Parameters
$imagesdir: Full path of the images directory.
Return value
Array of image files.
2 calls to _textimage_image_list()
File
- ./
textimage_admin.inc, line 861
Code
function _textimage_image_list($imagesdir) {
$filelist = array();
if (is_dir($imagesdir) && ($handle = opendir($imagesdir))) {
while ($file = readdir($handle)) {
if (preg_match("/\\.gif|\\.png|\\.jpg\$/i", $file) == 1) {
$filelist[] = $imagesdir . '/' . $file;
}
}
closedir($handle);
}
return $filelist;
}