How to remove file path when using Glob ()?

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

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

Use basename

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

Source: https://habr.com/ru/post/1442097/


All Articles