$v){ $tmp = explode("/",$v); $fname = $tmp[count($tmp)-1]; $text.=$fname.'|'.md5_file($v)."\n"; } if(empty($text)){ file_put_contents('list.txt',' '); @chmod('list.txt', 0777); die("No any .jpg file found"); } file_put_contents('list.txt',$text); @chmod('list.txt', 0777); echo $text; ?>