PHP Get file name starting with prefix

前端 未结 3 1095
一个人的身影
一个人的身影 2021-01-07 19:10

This is a custom function. At the moment, this function get all the file in the default directory, strip \".php\" and list them.

The problem is that I want to only

3条回答
  •  有刺的猬
    2021-01-07 20:02

     $target_file_png = glob($target_dir.'/group_'.$groupId.'*.png'); 
    

    $target_file_png will return an array containing all the files in folder specified in the path $target_dir starting with '/group_'.$groupId.' and specify the file format as *.png

提交回复
热议问题