finding files in a dir
问题 I have a directory with a lot of files inside: pic_1_79879879879879879.jpg pic_1_89798798789798789.jpg pic_1_45646545646545646.jpg pic_2_12345678213145646.jpg pic_3_78974565646465645.jpg etc... I need to list only the pic_1_ files. Any idea how I can do? Thanks in advance. 回答1: The opend dir function will help you $dir ="your path here"; $filetoread ="pic_1_"; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if (strpos($file,$filetoread) !== false)