如何在使用Glob()时删除文件路径?

时间:2022-09-01 23:34:49

I just want to display the name of my images, without the path (../uploadedImages/)

我只想显示图像的名称,而不显示路径(.. ./uploadedImages/)

<?php $images = glob("../uploadedImages/[kK]*.{jpg,png,gif,bmp}",GLOB_BRACE);   
foreach($images as $image) {echo "$image<br>"} ?>

1 个解决方案

#1


17  

Use basename

使用:

echo basename($image) . "<br>";

#1


17  

Use basename

使用:

echo basename($image) . "<br>";