help with glob pattern

前端 未结 4 378
萌比男神i
萌比男神i 2020-12-21 00:42

It would be nice if someone could give me a regexp pattern for glob for getting below filenames:

1.jpg // this file
1_thumb.jpg
2.png // this file
2_thumb.pn         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-21 01:22

    foreach (glob('[0-9]*') as $filename) {
        if (strpos("$filename","_thumb") === FALSE){
            echo "$filename \n";
        }
    }
    

提交回复
热议问题