Skip to content

Instantly share code, notes, and snippets.



Created Feb 20, 2015
What would you like to do?
Script scan photo on dir
$patch=$_SERVER["DOCUMENT_ROOT"]."/bitrix/script foto/News foto/".$dt."/".$nub."/";
$source = str_replace($_SERVER["DOCUMENT_ROOT"], "/", $patch);
$f = scandir($patch);
foreach ($f as $file){
if (!(preg_match('/\.(jpg)/', $file) || preg_match('/\.(JPG)/', $file))) {
$key = array_search($file, $f);
if ($key !== false){
} else {
$html.='<a href="'.$source.''.$file.'" rel="lightbox[roadtrip]" ><img src="'.$source.'small/'.$file.'" border="0" /></a> ';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment