Filter Empty Elements From Tag Array

This commit is contained in:
seiichiro 2022-02-08 20:55:21 +01:00
parent e6459b8d70
commit 8416a663f8

View file

@ -141,7 +141,7 @@ if (!empty($curfiles)| !empty($dirs)) {
foreach ($curfiles as $index => $image) {
$data['imageurl'] = $imageurl.$dir.'/'.$image;
$data['imagename'] = $image;
$data['tags'] = explode(" ", pathinfo(trim(strstr(strtolower($image), ' - '), " -"))['filename']);
$data['tags'] = array_filter(explode(" ", pathinfo(trim(strstr(strtolower($image), ' - '), " -"))['filename']));
}
Template::view('tpl/single.html', $data);
}