How to get only images using scandir in PHP?

后端 未结 6 1325
逝去的感伤
逝去的感伤 2020-11-27 15:52

Is there any way to get only images with extensions jpeg, png, gif etc while using

$dir    = \'/tmp\';
$files1 = scand         


        
6条回答
  •  爱一瞬间的悲伤
    2020-11-27 16:07

    You can search the resulting array afterward and discard files not matching your criteria.

    scandir does not have the functionality you seek.

提交回复
热议问题