<?php function s_img($path){ $html=''; foreach (glob($path."*.png") as $fname) { $html .= '<img class="pimg" src="'.$fname.'" alt="" />'; } return $html; } ?>